Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

HUtilityGeometryCreation.h
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 #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  ~Vertex_List_Node() {}
34 
35  int ID;
36  HPoint point;
37  HPoint color_value;
38  float color_findex;
39  HPoint normal;
40  VArray<float> params;
41 
42  VArray<int> in_face_array;
43  int in_face_current;
44 
45  Vertex_List_Node * next;
46 };
47 
48 typedef std::multimap<int, Vertex_List_Node *>::iterator nodes_iterator;
49 
52 {
53 public:
54 
67  static bool GeneratePointOnCircle(HPoint * point, HPoint const & center, float radius, int axis, float angle, bool convert=true);
68 
81  static bool GeneratePointsOnCircle (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert=true);
82 
83 
98  static bool GeneratePointsOnCircularArc (HPoint points[], HPoint const & center, float radius, int axis, int numpoints, bool convert, float start_angle, float end_angle);
99 
107  static HC_KEY CreateWireframeCircleWithEllipse(const HPoint &x1, const HPoint &x2, const HPoint &x3 ) ;
108 
117  static HC_KEY CreateSphere(const char * segment, HPoint center, float radius, int num_faces);
118 
129  static HC_KEY CreateSphere(HPoint center, float radius, int numsides, HPoint axis, HPoint ref);
130 
142  static HC_KEY CreateCone(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
143 
155  static HC_KEY CreateCylinder(HPoint center, float radius, float height, int numsides, HPoint axis, HPoint ref);
156 
165  static HC_KEY CreateCuboid( HPoint const * max, HPoint const * min);
166 
168  static void SetupModellingMatrix(HVector axis, HVector ref, HVector side, HPoint pos);
169 
176  static HC_KEY CreateCuttingPlane(HBaseView *view, const char *segmentname = 0, bool createplane = true);
177 
178 
179 
185  static void SetCuttingPlaneVisibilityForAll(HC_KEY startkey, const char *visibility);
186 
193  static void AdjustCuttingPlaneRendering(HBaseView * view);
194 
200  static void AdjustSection(HBaseView *view, HC_KEY key);
201 
206  static void CreateThreeSidedSection(HBaseView *view);
207 
212  static void CreateTwoSidedSection(HBaseView *view);
213  static void CreateSlice(HBaseView *view, float relative_thickness = 0.1f);
214 
236  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
237  float points[],
238  int face_list_length, int face_vertex_indices[],
239  float normals[]=0, int per_face_vertex_normal_indices[]=0,
240  float color_values[]=0, int per_face_vertex_color_value_indices[]=0,
241  float color_findices[]=0, int per_face_vertex_color_findex_indices[]=0,
242  float params[]=0, int per_face_vertex_param_indices[]=0, int param_number=0,
243  float crease_angle = 0.f);
244 
245 #ifndef SWIG
246 
267  static HC_KEY CreateShellWithFaceSpecificVertexAttributes(
268  HPoint points[],
269  int face_list_length, int face_vertex_indices[],
270  HPoint normals[]=0, int per_face_vertex_normal_indices[]=0,
271  HPoint color_values[]=0, int per_face_vertex_color_value_indices[]=0,
272  float color_findices[]=0, int per_face_vertex_color_findex_indices[]=0,
273  float params[]=0, int per_face_vertex_param_indices[]=0, int param_number=0,
274  float crease_angle = 0.f);
275 #endif
276 
285  static HC_KEY GenerateFEAShell( HC_KEY definingShell, bool generateIsolines, const char *algorithm);
286 
296  static HC_KEY CreateSmoothedShell(
297  int PointCount,
298  const HPoint Points[],
299  int FaceListLength,
300  const int FaceList[],
301  float creaseAngle);
302 
321  static bool ComputeFIndexDemoData(HShellVertexData *pShellVertexData, int data_cycles = 30);
322 
323 
336  static HC_KEY CreateBoolean(HC_KEY target, HC_KEY tool, int bool_type);
337 
357  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);
358 
359 
374  static HC_KEY CreateShellFromPathSweep(int nProfilePoints, const HPoint pOuterProfilePoints[], const HPoint pInnerProfilePoints[], int nPathPoints, const HPoint pSweepPathPoints[], const bool bIsProfileClosed);
375 
376 private:
377 
378  /*
379  GenerateCuboidPoints creates the vertices of a cuboid based on two input points.
380  NOTE: I have to generate extra points here for each corner so that the
381  block appear to be flat shaded even in Goroud shading mode which is the only
382  realistic appearance for blocks - Rajesh B (16-Feb-01)
383  \param max A pointer to an HPoint object.
384  \param min A pointer to an HPoint object.
385  \param points A pointer to an array of HPoint objects. Passed by reference.
386  */
387  static void GenerateCuboidPoints( HPoint const * max, HPoint const * in, HPoint points[]);
388 
389 
390 
391 };
392 
393 #ifdef H_PACK_8
394 #pragma pack(pop)
395 #endif
396 
397 #endif
398 
399 
400 
401 
402 
This class provides utility functions for creating construction geometry as well as simple primitives...
Definition: HUtilityGeometryCreation.h:51
Definition: HUtilityGeometryCreation.h:28
#define HC_KEY
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:613
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