SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
Opening.hpp
1 //
2 // Opening.hpp
3 //
4 // Sketchup C++ Wrapper for C API
5 // MIT License
6 //
7 // Copyright (c) 2019 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 
28 #ifndef Opening_h
29 #define Opening_h
30 
31 #include <stdio.h>
32 
33 #include <SketchUpAPI/model/opening.h>
34 
35 #include "SUAPI-CppWrapper/Geometry.hpp"
36 #include "SUAPI-CppWrapper/model/ComponentInstance.hpp"
37 
38 
39 namespace CW {
40 
41 /*
42 * Opening wrapper
43 */
44 class Opening {
45  private:
46 
47  // Smart pointer used to keep track of copies of this object.
48  std::shared_ptr<SUOpeningRef> m_opening;
49 
50  public:
51  /** Constructor for null Opening value */
52  Opening();
53 
54  /** Unsafe Constructor **/
55  Opening(SUOpeningRef opening);
56 
57  /** Safe Constructor **/
58  Opening(std::shared_ptr<SUOpeningRef> opening);
59 
60  /** Copy constructor */
61  Opening(const Opening& other);
62 
63  /** Destructor */
64  ~Opening();
65 
66  /** Copy assignment operator */
67  Opening& operator=(const Opening& other);
68 
69  /*
70  * Test for invalid object
71  */
72  bool operator!() const;
73 
74  /**
75  * Retrieves the number of points of an opening.
76  * @since SketchUp 2014, API 2.0
77  * @return The number of points.
78  */
79  size_t get_num_points() const;
80 
81  /**
82  * Retrieves the points of an opening object.
83  * @since SketchUp 2014, API 2.0
84  * @return The points in the opening.
85  */
86  std::vector<Point3D> get_points() const;
87 
88 };
89 
90 }
91 #endif /* Opening_h */
std::vector< Point3D > get_points() const
Definition: Opening.cpp:105
size_t get_num_points() const
Definition: Opening.cpp:91
Definition: Color.hpp:34
Opening & operator=(const Opening &other)
Definition: Opening.cpp:74