1 | <?php |
||
17 | class STL |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $solidName; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $facets = array(); |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getSolidName(): string |
||
36 | |||
37 | /** |
||
38 | * @param string $solidName |
||
39 | * @return STL |
||
40 | */ |
||
41 | public function setSolidName(string $solidName): STL |
||
46 | |||
47 | // Class should never be instantiated directly, as it emulates constructor overloading. |
||
48 | private function __construct() |
||
51 | |||
52 | /** |
||
53 | * Class constructor from an STL string. |
||
54 | * |
||
55 | * Example STL file string: see STLTest $stlFileString property. |
||
56 | * |
||
57 | * @param string $stlFileContentString |
||
58 | * @return STL |
||
59 | */ |
||
60 | public static function fromString(string $stlFileContentString) : STL |
||
86 | |||
87 | /** |
||
88 | * Class constructor from an STL array. |
||
89 | * |
||
90 | * Example STL file array: see STLTest $stlFileArray property. |
||
91 | * |
||
92 | * @param array $stlFileArray |
||
93 | * @return STL |
||
94 | */ |
||
95 | public static function fromArray(array $stlFileArray) : STL |
||
106 | |||
107 | /** |
||
108 | * Adds a new facet normal object. |
||
109 | * |
||
110 | * @param STLFacetNormal $facetNormal |
||
111 | * @return STL |
||
112 | */ |
||
113 | public function addFacetNormal(STLFacetNormal $facetNormal) : STL |
||
118 | |||
119 | /** |
||
120 | * Returns the number of facets in this STL object. |
||
121 | * |
||
122 | * @return int |
||
123 | */ |
||
124 | public function getFacetNormalCount() : int |
||
128 | |||
129 | /** |
||
130 | * Returns facet normal object at position. |
||
131 | * |
||
132 | * @param int $position |
||
133 | * @return STLFacetNormal |
||
134 | */ |
||
135 | public function getFacetNormal(int $position) : STLFacetNormal |
||
139 | |||
140 | /** |
||
141 | * Sets a facet normal at a given position. |
||
142 | * |
||
143 | * @param int $position |
||
144 | * @param STLFacetNormal $facetNormal |
||
145 | * @return STL |
||
146 | */ |
||
147 | public function setFacetNormal(int $position, STLFacetNormal $facetNormal) : STL |
||
152 | |||
153 | /** |
||
154 | * Deletes a facet normal at a given position. |
||
155 | * |
||
156 | * @param int $position |
||
157 | * @return STL |
||
158 | */ |
||
159 | public function deleteFacetNormal(int $position) : STL |
||
166 | |||
167 | /** |
||
168 | * Converts STL back to array. |
||
169 | * |
||
170 | * @return array |
||
171 | */ |
||
172 | public function toArray() : array |
||
186 | |||
187 | /** |
||
188 | * Converts STL back to string. |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | public function toString() : string |
||
206 | } |