SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
Vertex.hpp
1 //
2 // Vertex.hpp
3 //
4 // Sketchup C++ Wrapper for C API
5 // MIT License
6 //
7 // Copyright (c) 2017 Tom Kaneko
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 
16 // The above copyright notice and this permission notice shall be included in all
17 // copies or substantial portions of the Software.
18 
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 // SOFTWARE.
26 //
27 #ifndef Vertex_hpp
28 #define Vertex_hpp
29 
30 #include <stdio.h>
31 
32 #include <SketchUpAPI/model/vertex.h>
33 
34 #include "SUAPI-CppWrapper/model/Entity.hpp"
35 #include "SUAPI-CppWrapper/Geometry.hpp"
36 
37 namespace CW {
38 
39 /*
40 * Vertex wrapper
41 */
42 class Vertex :public Entity {
43  private:
44  static SUVertexRef copy_reference(const Vertex& other);
45 
46  public:
47  /** Constructor for null Vertex value */
48  Vertex();
49 
50  Vertex(SUVertexRef vertex);
51 
52  /** Copy constructor */
53  Vertex(const Vertex& other);
54 
55  /** Destructor */
56  ~Vertex();
57 
58  /** Copy assignment operator */
59  Vertex& operator=(const Vertex& other);
60 
61  /**
62  * Returns the position of the vertex.
63  */
64  Point3D position() const;
65 
66  /*
67  * The class object can be converted to a SUVertexRef without loss of data.
68  */
69  SUVertexRef ref() const;
70  operator SUVertexRef() const;
71  operator SUVertexRef*();
72 
73  /**
74  * Returns the position of the vertex. An aliaas of method poistion();
75  */
76  operator SUPoint3D() const;
77  operator Point3D() const;
78 };
79 
80 } /* namespace CW */
81 #endif /* Vertex_hpp */
Point3D position() const
Definition: Vertex.cpp:79
Definition: Color.hpp:34
Vertex & operator=(const Vertex &other)
Definition: Vertex.cpp:68