Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityGeometryCreation.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: 7bce751bd444878efd706806521cf02b6fff329d $
13 //
14 #ifndef _HUTILITYGEOMETRYCREATION_H
15 #define _HUTILITYGEOMETRYCREATION_H
16 
17 #ifdef H_PACK_8
18 #pragma pack(push)
19 #pragma pack(8)
20 #endif
21 
22 #include "HTools.h"
23 #include "HUtility.h"
24 #include "varray.h"
25 #include <map>
26 
27 #define BOOLEAN_TYPE_NONE 0
28 #define BOOLEAN_TYPE_INTERSECT 1
29 #define BOOLEAN_TYPE_SUBTRACT 2
30 #define BOOLEAN_TYPE_UNION 3
31 
33 {
34 public:
35  Vertex_List_Node() : next(0) {
36  };
37 
39  };
40 
41  int ID;
42  HPoint point;
43  HPoint color_value;
44  float color_findex;
45  HPoint normal;
46  VArray<float> params;
47 
48  VArray<int> in_face_array;
49  int in_face_current;
50 
51  Vertex_List_Node * next;
52 };
53 
54 typedef std::multimap<int, Vertex_List_Node *>::iterator nodes_iterator;
55 
58 {
59 public:
60 
73  static bool GeneratePointOnCircle(HPoint * point, HPoint const & center, float radius, int axis, float angle, bool convert=true);
74 
87  static bool GeneratePointsOnCircle (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert=true);
88 
89 
104  static bool GeneratePointsOnCircularArc (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert, float start_angle, float end_angle);
105 
113  static HC_KEY CreateWireframeCircleWithEllipse(const HPoint &x1, const HPoint &x2, const HPoint &x3 ) ;
114 
123  static HC_KEY CreateSphere(const char * segment, HPoint center, float radius, int num_faces);
124 
135  static HC_KEY CreateSphere(HPoint center, float radius, int numsides, HPoint axis, HPoint ref);
136 
148  static HC_KEY CreateCone(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
149 
161  static HC_KEY CreateCylinder(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
162 
171  static HC_KEY CreateCuboid( HPoint * max, HPoint * min);
172 
174  static void SetupModellingMatrix(HVector axis, HVector ref, HVector side, HPoint pos);
175 
182  static HC_KEY CreateCuttingPlane(HBaseView *view, const char *segmentname = 0, bool createplane = true);
183 
184 
185 
191  static void SetCuttingPlaneVisibilityForAll(HC_KEY startkey, const char *visibility);
192 
199  static void AdjustCuttingPlaneRendering(HBaseView * view);
200 
206  static void AdjustSection(HBaseView *view, HC_KEY key);
207 
212  static void CreateThreeSidedSection(HBaseView *view);
213 
218  static void CreateTwoSidedSection(HBaseView *view);
219  static void CreateSlice(HBaseView *view, float relative_thickness = 0.1f);
220 
242  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
243  float *points,
244  int face_list_length, int *face_vertex_indices,
245  float *normals=0, int *per_face_vertex_normal_indices=0,
246  float *color_values=0, int *per_face_vertex_color_value_indices=0,
247  float *color_findices=0, int *per_face_vertex_color_findex_indices=0,
248  float *params=0, int *per_face_vertex_param_indices=0, int param_number=0,
249  float crease_angle = 0.f);
250 
251 #ifndef SWIG
252 
273  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
274  HPoint points[],
275  int face_list_length, int *face_vertex_indices,
276  HPoint normals[]=0, int *per_face_vertex_normal_indices=0,
277  HPoint color_values[]=0, int *per_face_vertex_color_value_indices=0,
278  float *color_findices=0, int *per_face_vertex_color_findex_indices=0,
279  float *params=0, int *per_face_vertex_param_indices=0, int param_number=0,
280  float crease_angle = 0.f);
281 #endif
282 
291  static HC_KEY GenerateFEAShell( HC_KEY definingShell, bool generateIsolines, const char *algorithm);
292 
302  static HC_KEY CreateSmoothedShell(
303  int PointCount,
304  const HPoint Points[],
305  int FaceListLength,
306  const int *FaceList,
307  float creaseAngle);
308 
327  static bool ComputeFIndexDemoData(HShellVertexData *pShellVertexData, int data_cycles = 30);
328 
329 
342  static HC_KEY CreateBoolean(HC_KEY target, HC_KEY tool, int bool_type);
343 
363  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);
364 
365 
380  static HC_KEY CreateShellFromPathSweep(int nProfilePoints, const HPoint pOuterProfilePoints[], const HPoint pInnerProfilePoints[], int nPathPoints, const HPoint pSweepPathPoints[], const bool bIsProfileClosed);
381 
382 private:
383 
384  /*
385  GenerateCuboidPoints creates the vertices of a cuboid based on two input points.
386  NOTE: I have to generate extra points here for each corner so that the
387  block appear to be flat shaded even in Goroud shading mode which is the only
388  realistic appearance for blocks - Rajesh B (16-Feb-01)
389  \param max A pointer to an HPoint object.
390  \param min A pointer to an HPoint object.
391  \param points A pointer to an array of HPoint objects. Passed by reference.
392  */
393  static void GenerateCuboidPoints( HPoint * max, HPoint * in, HPoint points[]);
394 
395 
396 
397 };
398 
399 #ifdef H_PACK_8
400 #pragma pack(pop)
401 #endif
402 
403 #endif
404 
405 
406 
407 
408 
This class provides utility functions for creating construction geometry as well as simple primitives...
Definition: HUtilityGeometryCreation.h:57
#define HC_KEY
Definition: HUtilityGeometryCreation.h:32
class HPoint HVector
The HVector class is the data type of a three-dimensional vector.
Definition: HGlobals.h:332
The HShellVertexData class encapsulates colormap index information associated with the vertices of a ...
Definition: HUtility.h:624
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337