HImCuttingGeometry.h
Go to the documentation of this file.
1 // Copyright (c) Tech Soft 3D
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 // HCuttingPlaneLinedata.h : interface of the HCuttingPlaneLinedata class
11 //
12 // supports creation of linked list of polylines which represent the lines
13 // of intersection with a cutting plane. supports insertion of these lines
14 // into a segment within the scene in HBaseView
15 
20 #ifndef _HIM_CUTTING_GEOMETRY_H
21 #define _HIM_CUTTING_GEOMETRY_H
22 
23 #ifdef H_PACK_8
24 #pragma pack(push)
25 #pragma pack(8)
26 #endif
27 
28 #include "HTools.h"
29 #include "hic_types.h"
30 
38 };
46 };
47 
48 
119 class MVO_API HImCuttingGeometry
120 {
121 public:
125 
139  void CreateCuttingGeometry(HC_KEY source_key, HC_KEY target_key,
140  int cutting_type=HIM_CUTTING_GEOMETRY_TYPE_POLYLINES,
141  int body_level=HIM_CUTTING_GEOMETRY_SEGMENT_BODY);
142 
148  void CreateCuttingGeometry(HC_KEY source_key, HC_KEY target_key, bool honor_modelling_matrices);
149 
152  static void RegisterCallbacks();
153 
156  void SetSmallestFeature(float smallest_feature) { m_smallest_feature = smallest_feature; }
158  float GetSmallestFeature() { return m_smallest_feature; }
163  void SetTolerance(float tolerance) { m_tolerance = tolerance; }
166  float GetTolerance() { return m_tolerance; }
167 
168 private:
169 
170  /* Collects all of the cutting lines into a list. This list can either be directly displayed as a collection
171  of lines, or merged into a closed loop for the purposes of computing a capping polygon. */
172  static void StoreCuttingPlaneLines (HIC_Rendition const *nr, int count, HIC_DC_Point const pts[]);
173  /* If we are computing capping polygon(s), this routine will allow us to determine when one body stops
174  and the next begins. */
175  static void StopBody (HIC_Rendition const *nr);
176  /* calls straight through to StopBody (see above) */
177  static void ShellBody (HIC_Rendition const *nr, HIC_Polyhedron const *phon);
178  /* calls straight through to StopBody (see above) */
179  static void SegmentBody (HIC_Rendition const *nr, HIC_Segment_Info const *seg);
180 
181  /* does the actual work for the new CreateCuttingGeometry */
182  static void GetCaps(HIC_Rendition const *nr, HIC_Polyhedron const *p);
183 
184  /* tracks whether we cook to lines, polylines, or faces. polylines and faces may be used together with a bitwise OR */
185  static int m_cutting_type;
186  /* used only to set the handedness of the cutting geometry segment */
187  static bool m_body_is_open;
188  static float m_smallest_feature;
189  /* the largest allowable distance between start and end to be considered a match for the purposes of
190  assembling polylines and testing for closed loops */
191  static float m_tolerance;
192  static struct vlist_s * m_lines; /* stores uncooked soup of lines */
193  static struct vlist_s * m_polylines; /* stores lines merged together where possible */
194  static struct vlist_s * m_faces; /* stores (probably closed) loops to be used as shell faces */
195  static HC_KEY m_target_segment;
196  static bool m_honor_matrices;
197 };
198 
199 
200 
201 #ifdef H_PACK_8
202 #pragma pack(pop)
203 #endif
204 
205 #endif
206 
207 
208 
209 
210 
211 
212 
213 
float GetTolerance()
Definition: HImCuttingGeometry.h:166
Line Type.
Definition: HImCuttingGeometry.h:35
Definition: HImCuttingGeometry.h:119
#define HC_KEY
float GetSmallestFeature()
Definition: HImCuttingGeometry.h:158
Segment Body.
Definition: HImCuttingGeometry.h:44
HIMCG_Cutting_Type
Definition: HImCuttingGeometry.h:34
Shell Body.
Definition: HImCuttingGeometry.h:45
Face Type.
Definition: HImCuttingGeometry.h:37
Polyline Type.
Definition: HImCuttingGeometry.h:36
void SetSmallestFeature(float smallest_feature)
Definition: HImCuttingGeometry.h:156
void SetTolerance(float tolerance)
Definition: HImCuttingGeometry.h:163
HIMCG_Body_Type
Definition: HImCuttingGeometry.h:43