Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityGeometryCreation.h
1 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
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 #ifndef _HUTILITYGEOMETRYCREATION_H
11 #define _HUTILITYGEOMETRYCREATION_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
18 #include "HTools.h"
19 #include "HUtility.h"
20 #include "varray.h"
21 #include <map>
22 
23 #define BOOLEAN_TYPE_NONE 0
24 #define BOOLEAN_TYPE_INTERSECT 1
25 #define BOOLEAN_TYPE_SUBTRACT 2
26 #define BOOLEAN_TYPE_UNION 3
27 
29 {
30 public:
31  Vertex_List_Node() : next(0) {
32  };
33 
35  };
36 
37  int ID;
38  HPoint point;
39  HPoint color_value;
40  float color_findex;
41  HPoint normal;
42  VArray<float> params;
43 
44  VArray<int> in_face_array;
45  int in_face_current;
46 
47  Vertex_List_Node * next;
48 };
49 
50 typedef std::multimap<int, Vertex_List_Node *>::iterator nodes_iterator;
51 
54 {
55 public:
56 
69  static bool GeneratePointOnCircle(HPoint * point, HPoint const & center, float radius, int axis, float angle, bool convert=true);
70 
83  static bool GeneratePointsOnCircle (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert=true);
84 
85 
100  static bool GeneratePointsOnCircularArc (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert, float start_angle, float end_angle);
101 
109  static HC_KEY CreateWireframeCircleWithEllipse(const HPoint &x1, const HPoint &x2, const HPoint &x3 ) ;
110 
119  static HC_KEY CreateSphere(const char * segment, HPoint center, float radius, int num_faces);
120 
131  static HC_KEY CreateSphere(HPoint center, float radius, int numsides, HPoint axis, HPoint ref);
132 
144  static HC_KEY CreateCone(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
145 
157  static HC_KEY CreateCylinder(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
158 
167  static HC_KEY CreateCuboid( HPoint const * max, HPoint const * min);
168 
170  static void SetupModellingMatrix(HVector axis, HVector ref, HVector side, HPoint pos);
171 
178  static HC_KEY CreateCuttingPlane(HBaseView *view, const char *segmentname = 0, bool createplane = true);
179 
180 
181 
187  static void SetCuttingPlaneVisibilityForAll(HC_KEY startkey, const char *visibility);
188 
195  static void AdjustCuttingPlaneRendering(HBaseView * view);
196 
202  static void AdjustSection(HBaseView *view, HC_KEY key);
203 
208  static void CreateThreeSidedSection(HBaseView *view);
209 
214  static void CreateTwoSidedSection(HBaseView *view);
215  static void CreateSlice(HBaseView *view, float relative_thickness = 0.1f);
216 
238  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
239  float *points,
240  int face_list_length, int *face_vertex_indices,
241  float *normals=0, int *per_face_vertex_normal_indices=0,
242  float *color_values=0, int *per_face_vertex_color_value_indices=0,
243  float *color_findices=0, int *per_face_vertex_color_findex_indices=0,
244  float *params=0, int *per_face_vertex_param_indices=0, int param_number=0,
245  float crease_angle = 0.f);
246 
247 #ifndef SWIG
248 
269  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
270  HPoint points[],
271  int face_list_length, int *face_vertex_indices,
272  HPoint normals[]=0, int *per_face_vertex_normal_indices=0,
273  HPoint color_values[]=0, int *per_face_vertex_color_value_indices=0,
274  float *color_findices=0, int *per_face_vertex_color_findex_indices=0,
275  float *params=0, int *per_face_vertex_param_indices=0, int param_number=0,
276  float crease_angle = 0.f);
277 #endif
278 
287  static HC_KEY GenerateFEAShell( HC_KEY definingShell, bool generateIsolines, const char *algorithm);
288 
298  static HC_KEY CreateSmoothedShell(
299  int PointCount,
300  const HPoint Points[],
301  int FaceListLength,
302  const int *FaceList,
303  float creaseAngle);
304 
323  static bool ComputeFIndexDemoData(HShellVertexData *pShellVertexData, int data_cycles = 30);
324 
325 
338  static HC_KEY CreateBoolean(HC_KEY target, HC_KEY tool, int bool_type);
339 
359  static HC_KEY CreateShellFromRotationalSweep(int nPoints, const HPoint profile[], const float *radii, float start_angle, float end_angle, int axis, const bool *hard, int n_sides);
360 
361 
376  static HC_KEY CreateShellFromPathSweep(int nProfilePoints, const HPoint pOuterProfilePoints[], const HPoint pInnerProfilePoints[], int nPathPoints, const HPoint pSweepPathPoints[], const bool bIsProfileClosed);
377 
378 private:
379 
380  /*
381  GenerateCuboidPoints creates the vertices of a cuboid based on two input points.
382  NOTE: I have to generate extra points here for each corner so that the
383  block appear to be flat shaded even in Goroud shading mode which is the only
384  realistic appearance for blocks - Rajesh B (16-Feb-01)
385  \param max A pointer to an HPoint object.
386  \param min A pointer to an HPoint object.
387  \param points A pointer to an array of HPoint objects. Passed by reference.
388  */
389  static void GenerateCuboidPoints( HPoint const * max, HPoint const * in, HPoint points[]);
390 
391 
392 
393 };
394 
395 #ifdef H_PACK_8
396 #pragma pack(pop)
397 #endif
398 
399 #endif
400 
401 
402 
403 
404 
This class provides utility functions for creating construction geometry as well as simple primitives...
Definition: HUtilityGeometryCreation.h:53
#define HC_KEY
Definition: HUtilityGeometryCreation.h:28
class HPoint HVector
The HVector class is the data type of a three-dimensional vector.
Definition: HGlobals.h:326
The HShellVertexData class encapsulates colormap index information associated with the vertices of a ...
Definition: HUtility.h:618
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332