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 
247 namespace Font
248 {
252  namespace Size
253  {
257  enum Units
258  {
259  UnknownUnits,
260  WorldSpaceUnits,
261  PixelUnits
262  };
263  };
264 };
265 
266 // ======================= end enums =======================
267 
268 
269 // ======================= start common classes =======================
270 
271 class Frame;
272 class LeaderLine;
273 class Orientation;
274 class Polyline;
275 class TextAttributes;
276 class Polygon;
277 
278 typedef HPoint Point;
279 typedef HPoint RGBColor;
280 typedef HCamera Camera;
281 
282 
286 class MVO_API Frame
287 {
288 public:
289  Frame();
290  Frame(Frame const & that);
291  ~Frame();
292 
293  void Set(Frame const & that);
294  Frame const & operator=(Frame const & that);
295 
297  unsigned int GetPolylineCount() const;
304  void GetPolylines(unsigned int & out_count, Polyline out_polylines[]) const;
309  void SetPolylines(unsigned int in_count, Polyline const in_polylines[]);
310 
311 private:
312  PMII::PrivateImpl * impl_;
313 };
314 
318 class MVO_API Drawing
319 {
320 public:
321  Drawing();
322  Drawing(Drawing const & that);
323  ~Drawing();
324 
325  void Set(Drawing const & that);
326  Drawing const & operator=(Drawing const & that);
327 
329  unsigned int GetPolygonCount() const;
336  void GetPolygons(unsigned int & out_count, Polygon out_polygons[]) const;
341  void SetPolygons(unsigned int in_count, Polygon const in_polygons[]);
342 
343 private:
344  PMII::PrivateImpl * impl_;
345 };
346 
347 
355 class MVO_API Orientation
356 {
357 public:
358  Orientation();
359  Orientation(Orientation const & that);
360  ~Orientation();
361 
362  void Set(Orientation const & that);
363  Orientation const & operator=(Orientation const & that);
364 
366  void GetXComponent(Point & out_component) const;
368  void GetXComponent(float & out_x, float & out_y, float & out_z) const;
370  void SetXComponent(Point const & in_component);
372  void SetXComponent(float in_x, float in_y, float in_z);
373 
375  void GetYComponent(Point & out_component) const;
377  void GetYComponent(float & out_x, float & out_y, float & out_z) const;
379  void SetYComponent(Point const & in_component);
381  void SetYComponent(float in_x, float in_y, float in_z);
382 
384  void GetZComponent(Point & out_component) const;
386  void GetZComponent(float & out_x, float & out_y, float & out_z) const;
388  void SetZComponent(Point const & in_component);
390  void SetZComponent(float in_x, float in_y, float in_z);
391 
393  void GetOriginComponent(Point & out_component) const;
395  void GetOriginComponent(float & out_x, float & out_y, float & out_z) const;
397  void SetOriginComponent(Point const & in_component);
399  void SetOriginComponent(float in_x, float in_y, float in_z);
400 
402  void GetMatrix(float out_matrix[16]) const;
404  void SetMatrix(float const in_matrix[16]);
405 
406 private:
407  PMII::PrivateImpl * impl_;
408 };
409 
410 
414 class MVO_API Polyline
415 {
416 public:
417  Polyline();
418  Polyline(Polyline const & that);
419  ~Polyline();
420 
421  void Set(Polyline const & that);
422  Polyline const & operator=(Polyline const & that);
423 
425  void GetRGBColor(RGBColor & out_color) const;
427  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
429  void SetRGBColor(RGBColor const & in_color);
431  void SetRGBColor(float const in_r, float const in_g, float const in_b);
432 
434  void GetLinePattern(char out_pattern[1024]) const;
436  void SetLinePattern(char const in_pattern[1024]);
437 
439  unsigned int GetPointCount() const;
446  void GetPoints(unsigned int & out_count, Point out_points[]) const;
453  void GetPoints(unsigned int & out_count, float out_points[]) const;
458  void SetPoints(unsigned int in_count, Point const in_points[]);
463  void SetPoints(unsigned int in_count, float const in_points[]);
464 
465 private:
466  PMII::PrivateImpl * impl_;
467 };
468 
472 class MVO_API Polygon
473 {
474 public:
475  Polygon();
476  Polygon(Polygon const & that);
477  ~Polygon();
478 
479  void Set(Polygon const & that);
480  Polygon const & operator=(Polygon const & that);
481 
483  void GetRGBColor(RGBColor & out_color) const;
485  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
487  void SetRGBColor(RGBColor const & in_color);
489  void SetRGBColor(float const in_r, float const in_g, float const in_b);
490 
492  unsigned int GetPointCount() const;
499  void GetPoints(unsigned int & out_count, Point out_points[]) const;
506  void GetPoints(unsigned int & out_count, float out_points[]) const;
511  void SetPoints(unsigned int in_count, Point const in_points[]);
516  void SetPoints(unsigned int in_count, float const in_points[]);
517 
518 private:
519  PMII::PrivateImpl * impl_;
520 };
521 
525 class MVO_API TextAttributes
526 {
527 public:
528  TextAttributes();
529  TextAttributes(TextAttributes const & that);
530  ~TextAttributes();
531 
532  void Set(TextAttributes const & that);
533  TextAttributes const & operator=(TextAttributes const & that);
534 
536  void GetInsertionPoint(Point & out_point) const;
538  void GetInsertionPoint(float & out_x, float & out_y, float & out_z) const;
540  void SetInsertionPoint(Point const & in_point);
542  void SetInsertionPoint(float in_x, float in_y, float in_z);
543 
545  void GetFontSize(float & out_size) const;
547  void SetFontSize(float const in_size);
548 
550  void GetFontSizeUnits(Font::Size::Units & out_units) const;
552  void SetFontSizeUnits(Font::Size::Units const in_units);
553 
555  void GetFontName(char * out_font_name) const;
557  void SetFontName(char const * in_font_name);
558 
560  void GetOrientation(Orientation & out_orientation) const;
562  void SetOrientation(Orientation const & in_orientation);
563 
565  void GetRGBColor(RGBColor & out_color) const;
567  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
569  void SetRGBColor(RGBColor const & in_color);
571  void SetRGBColor(float in_r, float in_g, float in_b);
572 
573 
575  bool IsBold() const;
577  bool IsItalic() const;
579  bool IsUnderlined() const;
581  bool IsStrikedThrough() const;
583  bool IsOverlined() const;
585  bool IsStreched() const;
587  bool IsWired() const;
589  bool IsFixedWidth() const;
591  void SetFormat(char const & in_format);
592 
594  double WidthScale() const;
596  void SetWidthScale(const double width_scale);
597 
598 private:
599  PMII::PrivateImpl * impl_;
600 };
601 
602 
608 class MVO_API String
609 {
610 public:
611  String();
612  String(char const * cstring);
613  String(wchar_t const * wstring);
614  String(H_WCS const & wcs);
615  String(H_UTF8 const & utf8);
616  String(String const & that);
617  ~String();
618 
619  void Set(String const & in_that);
620  String const & operator=(String const & in_that);
621 
623  char const * CStr() const;
625  wchar_t const * WStr() const;
627  size_t WLength() const;
628 
629  bool Equals(String const & in_that) const;
630  bool operator==(String const & in_that) const;
631  bool operator!=(String const & in_that) const;
632 
633 private:
634  PMII::PrivateImpl * impl_;
635 };
636 
640 class MVO_API Options
641 {
642 public:
643  Options();
644  Options(Options const & that);
645  ~Options();
646 
647  void Set(Options const & that);
648  Options const & operator=(Options const & that);
649 
651  void SetDisplayParallelToScreen(bool const in_parallel = true);
653  bool IsDisplayParallelToScreen() const;
654 
655 private:
656  PMII::PrivateImpl * impl_;
657 };
658 // ======================= end common classes =======================
659 
660 
661 // ====================== start actual entities =======================
662 
663 class Entity;
664 class DatumEntity;
665 class DimensionEntity;
667 class GenericEntity;
668 class GeometricToleranceEntity;
669 class NoteEntity;
670 class RoughnessEntity;
671 class ViewEntity;
672 
673 
678 class MVO_API Entity
679 {
680 public:
683  Entity(HC_KEY segment_key = INVALID_KEY);
684  Entity(Entity const & that);
685  virtual ~Entity();
686 
687  void Set(Entity const & that);
688  Entity const & operator=(Entity const & that);
689 
691  virtual Type GetType() const { return PMI::UnknownType; };
692 
694  HC_KEY GetSegmentKey() const;
695 
697  void GetFrame(Frame & out_frame) const;
699  void SetFrame(Frame const & in_frame);
700 
702  unsigned int GetLeaderLineCount() const;
709  void GetLeaderLines(unsigned int & out_count, Polyline out_leader_lines[]) const;
714  void SetLeaderLines(unsigned int in_count, Polyline const in_leader_lines[]);
715 
717  unsigned int GetLeaderSymbolCount() const;
724  void GetLeaderSymbols(unsigned int & out_count, Polygon out_leader_symbols[]) const;
729  void SetLeaderSymbols(unsigned int in_count, Polygon const in_leader_symbols[]);
730 
731 
733  void SetDisplayParallelToScreen(bool const in_parallel = true);
735  bool IsDisplayParallelToScreen() const;
736 
737 
739  void GetDrawing(Drawing & out_drawing) const;
741  void SetDrawing(Drawing const & in_drawing);
742 
743 
744 protected:
745  PMII::PrivateImpl * impl_;
746 };
747 
748 
752 class MVO_API DatumEntity : public Entity
753 {
754 public:
757  DatumEntity(HC_KEY segment_key = INVALID_KEY);
758  DatumEntity(DatumEntity const & that);
759  virtual ~DatumEntity();
760 
761  void Set(DatumEntity const & that);
762  DatumEntity const & operator=(DatumEntity const & that);
763 
764  virtual Type GetType() const { return PMI::DatumType; };
765 
767  Datum::Type GetDatumType() const;
769  void SetDatumType(Datum::Type const in_type);
770 
771  /* \return the number of labels for this DatumEntity */
772  unsigned int GetLabelCount() const;
782  void GetLabels(unsigned int & out_count, String out_labels[], TextAttributes out_text_attributes[]) const;
788  void SetLabels(unsigned int in_count, String const in_labels[], TextAttributes const in_text_attributes[]);
789 };
790 
791 
795 class MVO_API DimensionEntity : public Entity
796 {
797 public:
800  DimensionEntity(HC_KEY segment_key = INVALID_KEY);
801  DimensionEntity(DimensionEntity const & that);
802  virtual ~DimensionEntity();
803 
804  void Set(DimensionEntity const & that);
805  DimensionEntity const & operator=(DimensionEntity const & that);
806 
807  virtual Type GetType() const { return PMI::DimensionType; };
808 
810  Dimension::Type GetDimensionType() const;
812  void SetDimensionType(Dimension::Type const in_type);
813 
815  Dimension::SubType GetDimensionSubType() const;
817  void SetDimensionSubType(Dimension::SubType const in_sub_type);
818 
820  unsigned int GetStringCount() const;
830  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
836  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
837 };
838 
839 
843 class MVO_API FeatureControlFrameEntity : public Entity
844 {
845 public:
848  FeatureControlFrameEntity(HC_KEY segment_key = INVALID_KEY);
850  virtual ~FeatureControlFrameEntity();
851 
852  void Set(FeatureControlFrameEntity const & that);
853  FeatureControlFrameEntity const & operator=(FeatureControlFrameEntity const & that);
854 
855  virtual Type GetType() const { return PMI::FeatureControlFrameType; };
856 
862  void GetToleranceType(Tolerance::Type & out_tolerance_type, TextAttributes & out_text_attributes) const;
867  void SetToleranceType(Tolerance::Type const in_tolerance_type, TextAttributes const & in_text_attributes);
868 
874  void GetDiameterModifierType(DiameterModifier::Type & out_diameter_modifier_type, TextAttributes & out_text_attributes) const;
879  void SetDiameterModifierType(DiameterModifier::Type const in_diameter_modifier_type, TextAttributes const & in_text_attributes);
880 
886  void GetZoneToleranceMagnitude(String & out_zone_tolerance_magnitude, TextAttributes & out_text_attributes) const;
892  void SetZoneToleranceMagnitude(String const & in_zone_tolerance_magnitude, TextAttributes const & in_text_attributes);
893 
899  void GetFirstZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
905  void SetFirstZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
906 
912  void GetSecondZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
918  void SetSecondZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
919 
925  void GetProjectedMagnitude(String & out_projected_magnitude, TextAttributes & out_text_attributes) const;
931  void SetProjectedMagnitude(String const & in_projected_magnitude, TextAttributes const & in_text_attributes);
932 
934  unsigned int GetDatumReferenceCount() const;
948  void GetDatumReferences(unsigned int & out_count, String out_labels[], TextAttributes out_label_attributes[],
949  DatumModifier::Type out_modifiers[], TextAttributes out_modifier_attributes[]);
957  void SetDatumReferences(unsigned int in_count, String const in_labels[], TextAttributes const in_label_attributes[],
958  DatumModifier::Type const in_modifiers[], TextAttributes const in_modifier_attributes[]);
959 };
960 
961 
965 class MVO_API GenericEntity : public Entity
966 {
967 public:
970  GenericEntity(HC_KEY segment_key = INVALID_KEY);
971  GenericEntity(GenericEntity const & that);
972  virtual ~GenericEntity();
973 
974  void Set(GenericEntity const & that);
975  GenericEntity const & operator=(GenericEntity const & that);
976 
977  virtual Type GetType() const { return PMI::GenericType; };
978 
980  unsigned int GetStringCount() const;
990  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
996  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
997 
998 
1002  void SetDisplayParallelToScreen(bool const in_parallel = true);
1006  bool IsDisplayParallelToScreen() const;
1007 
1008 };
1009 
1010 
1014 class MVO_API NoteEntity : public Entity
1015 {
1016 public:
1019  NoteEntity(HC_KEY segment_key = INVALID_KEY);
1020  NoteEntity(NoteEntity const & that);
1021  virtual ~NoteEntity();
1022 
1023  void Set(NoteEntity const & that);
1024  NoteEntity const & operator=(NoteEntity const & that);
1025 
1026  virtual Type GetType() const { return PMI::NoteType; };
1027 
1029  unsigned int GetStringCount() const;
1039  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
1045  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
1046 };
1047 
1048 
1052 class MVO_API RoughnessEntity : public Entity
1053 {
1054 public:
1057  RoughnessEntity(HC_KEY segment_key = INVALID_KEY);
1058  RoughnessEntity(RoughnessEntity const & that);
1059  virtual ~RoughnessEntity();
1060 
1061  void Set(RoughnessEntity const & that);
1062  RoughnessEntity const & operator=(RoughnessEntity const & that);
1063 
1064  virtual Type GetType() const { return PMI::RoughnessType; };
1065 
1067  Roughness::Obtention::Type GetObtentionType() const;
1069  void SetObtentionType(Roughness::Obtention::Type const in_obtention_type);
1070 
1072  Roughness::Applicability::Type GetApplicabilityType() const;
1074  void SetApplicabilityType(Roughness::Applicability::Type const in_applicability_type);
1075 
1077  Roughness::Mode::Type GetModeType() const;
1079  void SetModeType(Roughness::Mode::Type const in_mode_type);
1080 
1082  unsigned int GetFieldCount() const;
1092  void GetFields(unsigned int & out_count, String out_fields[], TextAttributes out_text_attributes[]) const;
1098  void SetFields(unsigned int in_count, String const in_fields[], TextAttributes const in_text_attributes[]);
1099 };
1100 
1101 
1105 class MVO_API ViewEntity
1106 {
1107 public:
1110  ViewEntity(HC_KEY segment_key = INVALID_KEY);
1111  ViewEntity(ViewEntity const & that);
1112  virtual ~ViewEntity();
1113 
1114  void Set(ViewEntity const & that);
1115  ViewEntity const & operator=(ViewEntity const & that);
1116 
1118  void GetCamera(Camera & out_camera) const;
1120  void GetCamera(Point & out_position, Point & out_target, Point & out_up_vector, float & out_field_width, float & out_field_height,
1121  char out_projection[128]);
1123  void GetCamera(float out_position[3], float out_target[3], float out_up_vector[3], float & out_field_width, float & out_field_height,
1124  char out_projection[128]);
1126  void SetCamera(Camera const & in_camera);
1128  void SetCamera(Point const & in_position, Point const & in_target, Point const & in_up_vector, float in_field_width,
1129  float in_field_height, char const in_projection[128]);
1131  void SetCamera(float const in_position[3], float const in_target[3], float const in_up_vector[3], float in_field_width,
1132  float in_field_height, char const in_projection[128]);
1133 
1135  void GetFrame(Frame & out_frame) const;
1137  void SetFrame(Frame const & in_frame);
1138 
1140  void GetName(String & out_name) const;
1142  void SetName(String const & in_name);
1145  void SetName(char const * in_utf8_string);
1146 
1148  unsigned int GetAssociatedEntityCount() const;
1155  void GetAssociatedEntities(unsigned int & out_count, Entity out_entities[]) const;
1160  void SetAssociatedEntities(unsigned int in_count, Entity const in_entities[]);
1161 
1162 protected:
1163  PMII::PrivateImpl * impl_;
1164 };
1165 
1166 // ====================== end actual entities =======================
1167 
1168 
1169 }; // PMI
1170 
1171 #ifdef H_PACK_8
1172 #pragma pack(pop)
1173 #endif
1174 
1175 #endif // _HUTILITYPMI_H
Definition: HUtilityPMI.h:678
Definition: HUtilityPMI.h:608
virtual Type GetType() const
Definition: HUtilityPMI.h:1026
Definition: HUtilityPMI.h:179
Definition: HUtilityPMI.h:1014
Definition: HUtilityPMI.h:24
Definition: HUtilityPMI.h:147
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:540
virtual Type GetType() const
Definition: HUtilityPMI.h:764
Definition: HUtilityPMI.h:286
Definition: HDWFMisc.h:22
Definition: HUtilityPMI.h:93
Definition: HUtilityPMI.h:318
Definition: HUtilityPMI.h:843
Definition: HUtilityPMI.h:472
Definition: HUtilityPMI.h:27
Definition: HUtilityPMI.h:242
Definition: HUtilityPMI.h:414
Definition: HUtilityPMI.h:131
virtual Type GetType() const
Definition: HUtilityPMI.h:691
Definition: HUtilityPMI.h:1052
Definition: HUtilityPMI.h:114
virtual Type GetType() const
Definition: HUtilityPMI.h:977
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
Type
Definition: HUtilityPMI.h:40
virtual Type GetType() const
Definition: HUtilityPMI.h:1064
Definition: HUtilityPMI.h:355
Definition: HUtilityPMI.h:525
Definition: HUtilityPMI.h:219
Definition: HUtilityPMI.h:1105
virtual Type GetType() const
Definition: HUtilityPMI.h:807
Definition: HUtilityPMI.h:201
virtual Type GetType() const
Definition: HUtilityPMI.h:855
Definition: HUtilityPMI.h:795
Definition: HUtilityPMI.h:965
Definition: HUtilityPMI.h:65
Definition: HUtilityPMI.h:752
Definition: HUtilityPMI.h:640