1 /*
2 * Copyright (C) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "mmi_point.h"
17 #include <iostream>
18
19 #include "hilog/log.h"
20
21 namespace OHOS {
22 namespace {
23 using namespace OHOS::HiviewDFX;
24 constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, 0xD002800, "MmiPoint" };
25 }
26
MmiPoint()27 MmiPoint::MmiPoint() {}
28
MmiPoint(float px,float py)29 MmiPoint::MmiPoint(float px, float py)
30 {
31 px_ = px;
32 py_ = py;
33 }
34
MmiPoint(float px,float py,float pz)35 MmiPoint::MmiPoint(float px, float py, float pz)
36 {
37 px_ = px;
38 py_ = py;
39 pz_ = pz;
40 }
41
GetX()42 float MmiPoint::GetX()
43 {
44 return px_;
45 }
46
GetY()47 float MmiPoint::GetY()
48 {
49 return py_;
50 }
51
GetZ()52 float MmiPoint::GetZ()
53 {
54 return pz_;
55 }
56
ToString()57 std::string MmiPoint::ToString()
58 {
59 HiLog::Info(LABEL, "%{public}s px = %{public}f, py = %{public}f, pz = %{public}f", __func__, px_, py_, pz_);
60 return "MmiPoint{ px = "+std::to_string(px_)+", py = "+std::to_string(py_)+", pz = "+std::to_string(pz_)+"}";
61 }
62 } // namespace OHOS