HUtilityPMI.h
1 // Copyright (c) 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 _HUTILITYPMI_H
11 #define _HUTILITYPMI_H
12 
13 #include "hc.h"
14 
15 #include "HTools.h"
16 #include "HGlobals.h"
17 #include "HUtility.h"
18 
19 #ifdef H_PACK_8
20 #pragma pack(push)
21 #pragma pack(8)
22 #endif
23 
24 namespace PMII
25 {
26  class PrivateImpl;
27 };
28 
32 namespace PMI
33 {
34 
35 // ======================= start enums =======================
36 
40 enum Type
41 {
42  UnknownType,
43  DatumType,
44  DimensionType,
45  FeatureControlFrameType,
46  GenericType,
47  NoteType,
48  RoughnessType
49 };
50 
54 namespace Datum
55 {
59  enum Type
60  {
61  Unknown,
62  Identifier,
63  Target
64  };
65 };
66 
70 namespace Tolerance
71 {
75  enum Type
76  {
77  Unknown,
78  Angularity,
79  Circularity,
80  CircularRunout,
81  Concentricity,
82  Cylindricity,
83  Flatness,
84  LineProfile,
85  Parallelism,
86  Perpendicularity,
87  Position,
88  Straightness,
89  SurfaceProfile,
90  Symmetry,
91  TotalRunout
92  };
93 };
94 
98 namespace ZoneModifier
99 {
103  enum Type
104  {
105  None,
106  MaximumMaterialCondition,
107  LeastMaterialCondition,
108  RegardlessOfFeatureSize,
109  TangentPlane,
110  ProjectedToleranceZone,
111  FreeState,
112  StatisticalTolerance
113  };
114 };
115 
119 namespace DatumModifier
120 {
124  enum Type
125  {
126  None,
127  MaximumMaterialCondition,
128  LeastMaterialCondition,
129  RegardlessOfFeatureSize
130  };
131 };
132 
136 namespace DiameterModifier
137 {
141  enum Type
142  {
143  None,
144  Diameter,
145  SphericalDiameter
146  };
147 };
148 
152 namespace Dimension
153 {
157  enum Type
158  {
159  UnknownType,
160  BasicType,
161  ReferenceType,
162  ToleranceType
163  };
164 
168  enum SubType
169  {
170  UnknownSubType,
171  AngleSubType,
172  ChamferSubType,
173  DiameterSubType,
174  DistanceSubType,
175  LengthSubType,
176  RadiusSubType,
177  SlopeSubType
178  };
179 };
180 
184 namespace Roughness
185 {
189  namespace Obtention
190  {
194  enum Type
195  {
196  Unknown,
197  NotDefined,
198  MachiningMandatory,
199  MachiningForbidden
200  };
201  };
202 
206  namespace Applicability
207  {
211  enum Type
212  {
213  Unknown,
214  SpecifiedSurface,
215  SurroundingSurfaces,
216  BasicSurface,
217  AllSurfaces
218  };
219  };
220 
224  namespace Mode
225  {
229  enum Type
230  {
231  Unknown,
232  None,
233  MultiDirectional,
234  Circular,
235  Radial,
236  Particular,
237  WithAngles,
238  Parallel,
239  Perpendicular
240  };
241  };
242 };
243 
244 // ======================= end enums =======================
245 
246 
247 // ======================= start common classes =======================
248 
249 class Frame;
250 class LeaderLine;
251 class Orientation;
252 class Polyline;
253 class TextAttributes;
254 class Polygon;
255 
256 typedef HPoint Point;
257 typedef HPoint RGBColor;
258 typedef HCamera Camera;
259 
260 
264 class MVO_API Frame
265 {
266 public:
267  Frame();
268  Frame(Frame const & that);
269  ~Frame();
270 
271  void Set(Frame const & that);
272  Frame const & operator=(Frame const & that);
273 
275  unsigned int GetPolylineCount() const;
282  void GetPolylines(unsigned int & out_count, Polyline out_polylines[]) const;
287  void SetPolylines(unsigned int in_count, Polyline const in_polylines[]);
288 
289 private:
290  PMII::PrivateImpl * impl_;
291 };
292 
296 class MVO_API Drawing
297 {
298 public:
299  Drawing();
300  Drawing(Drawing const & that);
301  ~Drawing();
302 
303  void Set(Drawing const & that);
304  Drawing const & operator=(Drawing const & that);
305 
307  unsigned int GetPolygonCount() const;
314  void GetPolygons(unsigned int & out_count, Polygon out_polygons[]) const;
319  void SetPolygons(unsigned int in_count, Polygon const in_polygons[]);
320 
321 private:
322  PMII::PrivateImpl * impl_;
323 };
324 
325 
333 class MVO_API Orientation
334 {
335 public:
336  Orientation();
337  Orientation(Orientation const & that);
338  ~Orientation();
339 
340  void Set(Orientation const & that);
341  Orientation const & operator=(Orientation const & that);
342 
344  void GetXComponent(Point & out_component) const;
346  void GetXComponent(float & out_x, float & out_y, float & out_z) const;
348  void SetXComponent(Point const & in_component);
350  void SetXComponent(float in_x, float in_y, float in_z);
351 
353  void GetYComponent(Point & out_component) const;
355  void GetYComponent(float & out_x, float & out_y, float & out_z) const;
357  void SetYComponent(Point const & in_component);
359  void SetYComponent(float in_x, float in_y, float in_z);
360 
362  void GetZComponent(Point & out_component) const;
364  void GetZComponent(float & out_x, float & out_y, float & out_z) const;
366  void SetZComponent(Point const & in_component);
368  void SetZComponent(float in_x, float in_y, float in_z);
369 
371  void GetOriginComponent(Point & out_component) const;
373  void GetOriginComponent(float & out_x, float & out_y, float & out_z) const;
375  void SetOriginComponent(Point const & in_component);
377  void SetOriginComponent(float in_x, float in_y, float in_z);
378 
380  void GetMatrix(float out_matrix[16]) const;
382  void SetMatrix(float const in_matrix[16]);
383 
384 private:
385  PMII::PrivateImpl * impl_;
386 };
387 
388 
392 class MVO_API Polyline
393 {
394 public:
395  Polyline();
396  Polyline(Polyline const & that);
397  ~Polyline();
398 
399  void Set(Polyline const & that);
400  Polyline const & operator=(Polyline const & that);
401 
403  void GetRGBColor(RGBColor & out_color) const;
405  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
407  void SetRGBColor(RGBColor const & in_color);
409  void SetRGBColor(float const in_r, float const in_g, float const in_b);
410 
412  void GetLinePattern(char out_pattern[1024]) const;
414  void SetLinePattern(char const in_pattern[1024]);
415 
417  unsigned int GetPointCount() const;
424  void GetPoints(unsigned int & out_count, Point out_points[]) const;
431  void GetPoints(unsigned int & out_count, float out_points[]) const;
436  void SetPoints(unsigned int in_count, Point const in_points[]);
441  void SetPoints(unsigned int in_count, float const in_points[]);
442 
443 private:
444  PMII::PrivateImpl * impl_;
445 };
446 
450 class MVO_API Polygon
451 {
452 public:
453  Polygon();
454  Polygon(Polygon const & that);
455  ~Polygon();
456 
457  void Set(Polygon const & that);
458  Polygon const & operator=(Polygon const & that);
459 
461  void GetRGBColor(RGBColor & out_color) const;
463  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
465  void SetRGBColor(RGBColor const & in_color);
467  void SetRGBColor(float const in_r, float const in_g, float const in_b);
468 
470  unsigned int GetPointCount() const;
477  void GetPoints(unsigned int & out_count, Point out_points[]) const;
484  void GetPoints(unsigned int & out_count, float out_points[]) const;
489  void SetPoints(unsigned int in_count, Point const in_points[]);
494  void SetPoints(unsigned int in_count, float const in_points[]);
495 
496 private:
497  PMII::PrivateImpl * impl_;
498 };
499 
503 class MVO_API TextAttributes
504 {
505 public:
506  TextAttributes();
507  TextAttributes(TextAttributes const & that);
508  ~TextAttributes();
509 
510  void Set(TextAttributes const & that);
511  TextAttributes const & operator=(TextAttributes const & that);
512 
514  void GetInsertionPoint(Point & out_point) const;
516  void GetInsertionPoint(float & out_x, float & out_y, float & out_z) const;
518  void SetInsertionPoint(Point const & in_point);
520  void SetInsertionPoint(float in_x, float in_y, float in_z);
521 
523  void GetFontSize(float & out_size) const;
525  void SetFontSize(float const in_size);
526 
528  void GetFontName(char * out_font_name) const;
530  void SetFontName(char const * in_font_name);
531 
533  void GetOrientation(Orientation & out_orientation) const;
535  void SetOrientation(Orientation const & in_orientation);
536 
538  void GetRGBColor(RGBColor & out_color) const;
540  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
542  void SetRGBColor(RGBColor const & in_color);
544  void SetRGBColor(float in_r, float in_g, float in_b);
545 
546 
548  bool IsBold() const;
550  bool IsItalic() const;
552  bool IsUnderlined() const;
554  bool IsStrikedThrough() const;
556  bool IsOverlined() const;
558  bool IsStreched() const;
560  bool IsWired() const;
562  bool IsFixedWidth() const;
564  void SetFormat(char const & in_format);
565 
567  double WidthScale() const;
569  void SetWidthScale(const double width_scale);
570 
571 private:
572  PMII::PrivateImpl * impl_;
573 };
574 
575 
581 class MVO_API String
582 {
583 public:
584  String();
585  String(char const * cstring);
586  String(wchar_t const * wstring);
587  String(H_WCS const & wcs);
588  String(H_UTF8 const & utf8);
589  String(String const & that);
590  ~String();
591 
592  void Set(String const & in_that);
593  String const & operator=(String const & in_that);
594 
596  char const * CStr() const;
598  wchar_t const * WStr() const;
600  size_t WLength() const;
601 
602  bool Equals(String const & in_that) const;
603  bool operator==(String const & in_that) const;
604  bool operator!=(String const & in_that) const;
605 
606 private:
607  PMII::PrivateImpl * impl_;
608 };
609 
613 class MVO_API Options
614 {
615 public:
616  Options();
617  Options(Options const & that);
618  ~Options();
619 
620  void Set(Options const & that);
621  Options const & operator=(Options const & that);
622 
624  void SetDisplayParallelToScreen(bool const in_parallel = true);
626  bool IsDisplayParallelToScreen() const;
627 
628 private:
629  PMII::PrivateImpl * impl_;
630 };
631 // ======================= end common classes =======================
632 
633 
634 // ====================== start actual entities =======================
635 
636 class Entity;
637 class DatumEntity;
638 class DimensionEntity;
640 class GenericEntity;
641 class GeometricToleranceEntity;
642 class NoteEntity;
643 class RoughnessEntity;
644 class ViewEntity;
645 
646 
651 class MVO_API Entity
652 {
653 public:
656  Entity(HC_KEY segment_key = INVALID_KEY);
657  Entity(Entity const & that);
658  virtual ~Entity();
659 
660  void Set(Entity const & that);
661  Entity const & operator=(Entity const & that);
662 
664  virtual Type GetType() const { return PMI::UnknownType; };
665 
667  HC_KEY GetSegmentKey() const;
668 
670  void GetFrame(Frame & out_frame) const;
672  void SetFrame(Frame const & in_frame);
673 
675  unsigned int GetLeaderLineCount() const;
682  void GetLeaderLines(unsigned int & out_count, Polyline out_leader_lines[]) const;
687  void SetLeaderLines(unsigned int in_count, Polyline const in_leader_lines[]);
688 
690  unsigned int GetLeaderSymbolCount() const;
697  void GetLeaderSymbols(unsigned int & out_count, Polygon out_leader_symbols[]) const;
702  void SetLeaderSymbols(unsigned int in_count, Polygon const in_leader_symbols[]);
703 
704 
706  void SetDisplayParallelToScreen(bool const in_parallel = true);
708  bool IsDisplayParallelToScreen() const;
709 
710 
712  void GetDrawing(Drawing & out_drawing) const;
714  void SetDrawing(Drawing const & in_drawing);
715 
716 
717 protected:
718  PMII::PrivateImpl * impl_;
719 };
720 
721 
725 class MVO_API DatumEntity : public Entity
726 {
727 public:
730  DatumEntity(HC_KEY segment_key = INVALID_KEY);
731  DatumEntity(DatumEntity const & that);
732  virtual ~DatumEntity();
733 
734  void Set(DatumEntity const & that);
735  DatumEntity const & operator=(DatumEntity const & that);
736 
737  virtual Type GetType() const { return PMI::DatumType; };
738 
740  Datum::Type GetDatumType() const;
742  void SetDatumType(Datum::Type const in_type);
743 
744  /* \return the number of labels for this DatumEntity */
745  unsigned int GetLabelCount() const;
755  void GetLabels(unsigned int & out_count, String out_labels[], TextAttributes out_text_attributes[]) const;
761  void SetLabels(unsigned int in_count, String const in_labels[], TextAttributes const in_text_attributes[]);
762 };
763 
764 
768 class MVO_API DimensionEntity : public Entity
769 {
770 public:
773  DimensionEntity(HC_KEY segment_key = INVALID_KEY);
774  DimensionEntity(DimensionEntity const & that);
775  virtual ~DimensionEntity();
776 
777  void Set(DimensionEntity const & that);
778  DimensionEntity const & operator=(DimensionEntity const & that);
779 
780  virtual Type GetType() const { return PMI::DimensionType; };
781 
783  Dimension::Type GetDimensionType() const;
785  void SetDimensionType(Dimension::Type const in_type);
786 
788  Dimension::SubType GetDimensionSubType() const;
790  void SetDimensionSubType(Dimension::SubType const in_sub_type);
791 
793  unsigned int GetStringCount() const;
803  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
809  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
810 };
811 
812 
816 class MVO_API FeatureControlFrameEntity : public Entity
817 {
818 public:
821  FeatureControlFrameEntity(HC_KEY segment_key = INVALID_KEY);
823  virtual ~FeatureControlFrameEntity();
824 
825  void Set(FeatureControlFrameEntity const & that);
826  FeatureControlFrameEntity const & operator=(FeatureControlFrameEntity const & that);
827 
828  virtual Type GetType() const { return PMI::FeatureControlFrameType; };
829 
835  void GetToleranceType(Tolerance::Type & out_tolerance_type, TextAttributes & out_text_attributes) const;
840  void SetToleranceType(Tolerance::Type const in_tolerance_type, TextAttributes const & in_text_attributes);
841 
847  void GetDiameterModifierType(DiameterModifier::Type & out_diameter_modifier_type, TextAttributes & out_text_attributes) const;
852  void SetDiameterModifierType(DiameterModifier::Type const in_diameter_modifier_type, TextAttributes const & in_text_attributes);
853 
859  void GetZoneToleranceMagnitude(String & out_zone_tolerance_magnitude, TextAttributes & out_text_attributes) const;
865  void SetZoneToleranceMagnitude(String const & in_zone_tolerance_magnitude, TextAttributes const & in_text_attributes);
866 
872  void GetFirstZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
878  void SetFirstZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
879 
885  void GetSecondZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
891  void SetSecondZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
892 
898  void GetProjectedMagnitude(String & out_projected_magnitude, TextAttributes & out_text_attributes) const;
904  void SetProjectedMagnitude(String const & in_projected_magnitude, TextAttributes const & in_text_attributes);
905 
907  unsigned int GetDatumReferenceCount() const;
921  void GetDatumReferences(unsigned int & out_count, String out_labels[], TextAttributes out_label_attributes[],
922  DatumModifier::Type out_modifiers[], TextAttributes out_modifier_attributes[]);
930  void SetDatumReferences(unsigned int in_count, String const in_labels[], TextAttributes const in_label_attributes[],
931  DatumModifier::Type const in_modifiers[], TextAttributes const in_modifier_attributes[]);
932 };
933 
934 
938 class MVO_API GenericEntity : public Entity
939 {
940 public:
943  GenericEntity(HC_KEY segment_key = INVALID_KEY);
944  GenericEntity(GenericEntity const & that);
945  virtual ~GenericEntity();
946 
947  void Set(GenericEntity const & that);
948  GenericEntity const & operator=(GenericEntity const & that);
949 
950  virtual Type GetType() const { return PMI::GenericType; };
951 
953  unsigned int GetStringCount() const;
963  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
969  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
970 
971 
975  void SetDisplayParallelToScreen(bool const in_parallel = true);
979  bool IsDisplayParallelToScreen() const;
980 
981 };
982 
983 
987 class MVO_API NoteEntity : public Entity
988 {
989 public:
992  NoteEntity(HC_KEY segment_key = INVALID_KEY);
993  NoteEntity(NoteEntity const & that);
994  virtual ~NoteEntity();
995 
996  void Set(NoteEntity const & that);
997  NoteEntity const & operator=(NoteEntity const & that);
998 
999  virtual Type GetType() const { return PMI::NoteType; };
1000 
1002  unsigned int GetStringCount() const;
1012  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
1018  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
1019 };
1020 
1021 
1025 class MVO_API RoughnessEntity : public Entity
1026 {
1027 public:
1030  RoughnessEntity(HC_KEY segment_key = INVALID_KEY);
1031  RoughnessEntity(RoughnessEntity const & that);
1032  virtual ~RoughnessEntity();
1033 
1034  void Set(RoughnessEntity const & that);
1035  RoughnessEntity const & operator=(RoughnessEntity const & that);
1036 
1037  virtual Type GetType() const { return PMI::RoughnessType; };
1038 
1040  Roughness::Obtention::Type GetObtentionType() const;
1042  void SetObtentionType(Roughness::Obtention::Type const in_obtention_type);
1043 
1045  Roughness::Applicability::Type GetApplicabilityType() const;
1047  void SetApplicabilityType(Roughness::Applicability::Type const in_applicability_type);
1048 
1050  Roughness::Mode::Type GetModeType() const;
1052  void SetModeType(Roughness::Mode::Type const in_mode_type);
1053 
1055  unsigned int GetFieldCount() const;
1065  void GetFields(unsigned int & out_count, String out_fields[], TextAttributes out_text_attributes[]) const;
1071  void SetFields(unsigned int in_count, String const in_fields[], TextAttributes const in_text_attributes[]);
1072 };
1073 
1074 
1078 class MVO_API ViewEntity
1079 {
1080 public:
1083  ViewEntity(HC_KEY segment_key = INVALID_KEY);
1084  ViewEntity(ViewEntity const & that);
1085  virtual ~ViewEntity();
1086 
1087  void Set(ViewEntity const & that);
1088  ViewEntity const & operator=(ViewEntity const & that);
1089 
1091  void GetCamera(Camera & out_camera) const;
1093  void GetCamera(Point & out_position, Point & out_target, Point & out_up_vector, float & out_field_width, float & out_field_height,
1094  char out_projection[128]);
1096  void GetCamera(float out_position[3], float out_target[3], float out_up_vector[3], float & out_field_width, float & out_field_height,
1097  char out_projection[128]);
1099  void SetCamera(Camera const & in_camera);
1101  void SetCamera(Point const & in_position, Point const & in_target, Point const & in_up_vector, float in_field_width,
1102  float in_field_height, char const in_projection[128]);
1104  void SetCamera(float const in_position[3], float const in_target[3], float const in_up_vector[3], float in_field_width,
1105  float in_field_height, char const in_projection[128]);
1106 
1108  void GetFrame(Frame & out_frame) const;
1110  void SetFrame(Frame const & in_frame);
1111 
1113  void GetName(String & out_name) const;
1115  void SetName(String const & in_name);
1116 
1118  unsigned int GetAssociatedEntityCount() const;
1125  void GetAssociatedEntities(unsigned int & out_count, Entity out_entities[]) const;
1130  void SetAssociatedEntities(unsigned int in_count, Entity const in_entities[]);
1131 
1132 protected:
1133  PMII::PrivateImpl * impl_;
1134 };
1135 
1136 // ====================== end actual entities =======================
1137 
1138 
1139 }; // PMI
1140 
1141 #ifdef H_PACK_8
1142 #pragma pack(pop)
1143 #endif
1144 
1145 #endif // _HUTILITYPMI_H
Definition: HUtilityPMI.h:651
Definition: HUtilityPMI.h:581
Definition: HUtilityPMI.h:987
virtual Type GetType() const
Definition: HUtilityPMI.h:664
virtual Type GetType() const
Definition: HUtilityPMI.h:780
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:537
Definition: HUtilityPMI.h:264
Definition: HDWFMisc.h:22
Definition: HUtilityPMI.h:296
virtual Type GetType() const
Definition: HUtilityPMI.h:999
virtual Type GetType() const
Definition: HUtilityPMI.h:1037
#define HC_KEY
Definition: HUtilityPMI.h:816
Definition: HUtilityPMI.h:450
Definition: HUtilityPMI.h:392
Definition: HUtilityPMI.h:1025
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
Type
Definition: HUtilityPMI.h:40
Definition: HUtilityPMI.h:333
Definition: HUtilityPMI.h:503
Definition: HUtilityPMI.h:1078
Definition: HDGNHelper.h:446
Definition: HUtilityPMI.h:768
Definition: HUtilityPMI.h:938
Definition: HUtilityPMI.h:725
Definition: HUtilityPMI.h:613
virtual Type GetType() const
Definition: HUtilityPMI.h:828
virtual Type GetType() const
Definition: HUtilityPMI.h:737
virtual Type GetType() const
Definition: HUtilityPMI.h:950