Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityPMI.h
1 /*
2 * Copyright (c) 2004 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: 4945292e721f3809b26154b7b99902a0ef2f7e84 $
13 */
14 
15 #ifndef _HUTILITYPMI_H
16 #define _HUTILITYPMI_H
17 
18 #include "hc.h"
19 
20 #include "HTools.h"
21 #include "HGlobals.h"
22 #include "HUtility.h"
23 
24 #ifdef H_PACK_8
25 #pragma pack(push)
26 #pragma pack(8)
27 #endif
28 
29 namespace PMII
30 {
31  class PrivateImpl;
32 };
33 
37 namespace PMI
38 {
39 
40 // ======================= start enums =======================
41 
45 enum Type
46 {
47  UnknownType,
48  DatumType,
49  DimensionType,
50  FeatureControlFrameType,
51  GenericType,
52  NoteType,
53  RoughnessType
54 };
55 
59 namespace Datum
60 {
64  enum Type
65  {
66  Unknown,
67  Identifier,
68  Target
69  };
70 };
71 
75 namespace Tolerance
76 {
80  enum Type
81  {
82  Unknown,
83  Angularity,
84  Circularity,
85  CircularRunout,
86  Concentricity,
87  Cylindricity,
88  Flatness,
89  LineProfile,
90  Parallelism,
91  Perpendicularity,
92  Position,
93  Straightness,
94  SurfaceProfile,
95  Symmetry,
96  TotalRunout
97  };
98 };
99 
103 namespace ZoneModifier
104 {
108  enum Type
109  {
110  None,
111  MaximumMaterialCondition,
112  LeastMaterialCondition,
113  RegardlessOfFeatureSize,
114  TangentPlane,
115  ProjectedToleranceZone,
116  FreeState,
117  StatisticalTolerance
118  };
119 };
120 
124 namespace DatumModifier
125 {
129  enum Type
130  {
131  None,
132  MaximumMaterialCondition,
133  LeastMaterialCondition,
134  RegardlessOfFeatureSize
135  };
136 };
137 
141 namespace DiameterModifier
142 {
146  enum Type
147  {
148  None,
149  Diameter,
150  SphericalDiameter
151  };
152 };
153 
157 namespace Dimension
158 {
162  enum Type
163  {
164  UnknownType,
165  BasicType,
166  ReferenceType,
167  ToleranceType
168  };
169 
173  enum SubType
174  {
175  UnknownSubType,
176  AngleSubType,
177  ChamferSubType,
178  DiameterSubType,
179  DistanceSubType,
180  LengthSubType,
181  RadiusSubType,
182  SlopeSubType
183  };
184 };
185 
189 namespace Roughness
190 {
194  namespace Obtention
195  {
199  enum Type
200  {
201  Unknown,
202  NotDefined,
203  MachiningMandatory,
204  MachiningForbidden
205  };
206  };
207 
211  namespace Applicability
212  {
216  enum Type
217  {
218  Unknown,
219  SpecifiedSurface,
220  SurroundingSurfaces,
221  BasicSurface,
222  AllSurfaces
223  };
224  };
225 
229  namespace Mode
230  {
234  enum Type
235  {
236  Unknown,
237  None,
238  MultiDirectional,
239  Circular,
240  Radial,
241  Particular,
242  WithAngles,
243  Parallel,
244  Perpendicular
245  };
246  };
247 };
248 
249 // ======================= end enums =======================
250 
251 
252 // ======================= start common classes =======================
253 
254 class Frame;
255 class LeaderLine;
256 class Orientation;
257 class Polyline;
258 class TextAttributes;
259 class Polygon;
260 
261 typedef HPoint Point;
262 typedef HPoint RGBColor;
263 typedef HCamera Camera;
264 
265 
269 class MVO_API Frame
270 {
271 public:
272  Frame();
273  Frame(Frame const & that);
274  ~Frame();
275 
276  void Set(Frame const & that);
277  Frame const & operator=(Frame const & that);
278 
280  unsigned int GetPolylineCount() const;
287  void GetPolylines(unsigned int & out_count, Polyline out_polylines[]) const;
292  void SetPolylines(unsigned int in_count, Polyline const in_polylines[]);
293 
294 private:
295  PMII::PrivateImpl * impl_;
296 };
297 
301 class MVO_API Drawing
302 {
303 public:
304  Drawing();
305  Drawing(Drawing const & that);
306  ~Drawing();
307 
308  void Set(Drawing const & that);
309  Drawing const & operator=(Drawing const & that);
310 
312  unsigned int GetPolygonCount() const;
319  void GetPolygons(unsigned int & out_count, Polygon out_polygons[]) const;
324  void SetPolygons(unsigned int in_count, Polygon const in_polygons[]);
325 
326 private:
327  PMII::PrivateImpl * impl_;
328 };
329 
330 
338 class MVO_API Orientation
339 {
340 public:
341  Orientation();
342  Orientation(Orientation const & that);
343  ~Orientation();
344 
345  void Set(Orientation const & that);
346  Orientation const & operator=(Orientation const & that);
347 
349  void GetXComponent(Point & out_component) const;
351  void GetXComponent(float & out_x, float & out_y, float & out_z) const;
353  void SetXComponent(Point const & in_component);
355  void SetXComponent(float in_x, float in_y, float in_z);
356 
358  void GetYComponent(Point & out_component) const;
360  void GetYComponent(float & out_x, float & out_y, float & out_z) const;
362  void SetYComponent(Point const & in_component);
364  void SetYComponent(float in_x, float in_y, float in_z);
365 
367  void GetZComponent(Point & out_component) const;
369  void GetZComponent(float & out_x, float & out_y, float & out_z) const;
371  void SetZComponent(Point const & in_component);
373  void SetZComponent(float in_x, float in_y, float in_z);
374 
376  void GetOriginComponent(Point & out_component) const;
378  void GetOriginComponent(float & out_x, float & out_y, float & out_z) const;
380  void SetOriginComponent(Point const & in_component);
382  void SetOriginComponent(float in_x, float in_y, float in_z);
383 
385  void GetMatrix(float out_matrix[16]) const;
387  void SetMatrix(float const in_matrix[16]);
388 
389 private:
390  PMII::PrivateImpl * impl_;
391 };
392 
393 
397 class MVO_API Polyline
398 {
399 public:
400  Polyline();
401  Polyline(Polyline const & that);
402  ~Polyline();
403 
404  void Set(Polyline const & that);
405  Polyline const & operator=(Polyline const & that);
406 
408  void GetRGBColor(RGBColor & out_color) const;
410  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
412  void SetRGBColor(RGBColor const & in_color);
414  void SetRGBColor(float const in_r, float const in_g, float const in_b);
415 
417  void GetLinePattern(char out_pattern[1024]) const;
419  void SetLinePattern(char const in_pattern[1024]);
420 
422  unsigned int GetPointCount() const;
429  void GetPoints(unsigned int & out_count, Point out_points[]) const;
436  void GetPoints(unsigned int & out_count, float out_points[]) const;
441  void SetPoints(unsigned int in_count, Point const in_points[]);
446  void SetPoints(unsigned int in_count, float const in_points[]);
447 
448 private:
449  PMII::PrivateImpl * impl_;
450 };
451 
455 class MVO_API Polygon
456 {
457 public:
458  Polygon();
459  Polygon(Polygon const & that);
460  ~Polygon();
461 
462  void Set(Polygon const & that);
463  Polygon const & operator=(Polygon const & that);
464 
466  void GetRGBColor(RGBColor & out_color) const;
468  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
470  void SetRGBColor(RGBColor const & in_color);
472  void SetRGBColor(float const in_r, float const in_g, float const in_b);
473 
475  unsigned int GetPointCount() const;
482  void GetPoints(unsigned int & out_count, Point out_points[]) const;
489  void GetPoints(unsigned int & out_count, float out_points[]) const;
494  void SetPoints(unsigned int in_count, Point const in_points[]);
499  void SetPoints(unsigned int in_count, float const in_points[]);
500 
501 private:
502  PMII::PrivateImpl * impl_;
503 };
504 
508 class MVO_API TextAttributes
509 {
510 public:
511  TextAttributes();
512  TextAttributes(TextAttributes const & that);
513  ~TextAttributes();
514 
515  void Set(TextAttributes const & that);
516  TextAttributes const & operator=(TextAttributes const & that);
517 
519  void GetInsertionPoint(Point & out_point) const;
521  void GetInsertionPoint(float & out_x, float & out_y, float & out_z) const;
523  void SetInsertionPoint(Point const & in_point);
525  void SetInsertionPoint(float in_x, float in_y, float in_z);
526 
528  void GetFontSize(float & out_size) const;
530  void SetFontSize(float const in_size);
531 
533  void GetFontName(char * out_font_name) const;
535  void SetFontName(char const * in_font_name);
536 
538  void GetOrientation(Orientation & out_orientation) const;
540  void SetOrientation(Orientation const & in_orientation);
541 
543  void GetRGBColor(RGBColor & out_color) const;
545  void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
547  void SetRGBColor(RGBColor const & in_color);
549  void SetRGBColor(float in_r, float in_g, float in_b);
550 
551 
553  bool IsBold() const;
555  bool IsItalic() const;
557  bool IsUnderlined() const;
559  bool IsStrikedThrough() const;
561  bool IsOverlined() const;
563  bool IsStreched() const;
565  bool IsWired() const;
567  bool IsFixedWidth() const;
569  void SetFormat(char const & in_format);
570 
572  double WidthScale() const;
574  void SetWidthScale(const double width_scale);
575 
576 private:
577  PMII::PrivateImpl * impl_;
578 };
579 
580 
586 class MVO_API String
587 {
588 public:
589  String();
590  String(char const * cstring);
591  String(wchar_t const * wstring);
592  String(H_WCS const & wcs);
593  String(H_UTF8 const & utf8);
594  String(String const & that);
595  ~String();
596 
597  void Set(String const & in_that);
598  String const & operator=(String const & in_that);
599 
601  char const * CStr() const;
603  wchar_t const * WStr() const;
605  size_t WLength() const;
606 
607  bool Equals(String const & in_that) const;
608  bool operator==(String const & in_that) const;
609  bool operator!=(String const & in_that) const;
610 
611 private:
612  PMII::PrivateImpl * impl_;
613 };
614 
618 class MVO_API Options
619 {
620 public:
621  Options();
622  Options(Options const & that);
623  ~Options();
624 
625  void Set(Options const & that);
626  Options const & operator=(Options const & that);
627 
629  void SetDisplayParallelToScreen(bool const in_parallel = true);
631  bool IsDisplayParallelToScreen() const;
632 
633 private:
634  PMII::PrivateImpl * impl_;
635 };
636 // ======================= end common classes =======================
637 
638 
639 // ====================== start actual entities =======================
640 
641 class Entity;
642 class DatumEntity;
643 class DimensionEntity;
645 class GenericEntity;
646 class GeometricToleranceEntity;
647 class NoteEntity;
648 class RoughnessEntity;
649 class ViewEntity;
650 
651 
656 class MVO_API Entity
657 {
658 public:
661  Entity(HC_KEY segment_key = INVALID_KEY);
662  Entity(Entity const & that);
663  virtual ~Entity();
664 
665  void Set(Entity const & that);
666  Entity const & operator=(Entity const & that);
667 
669  virtual Type GetType() const { return PMI::UnknownType; };
670 
672  HC_KEY GetSegmentKey() const;
673 
675  void GetFrame(Frame & out_frame) const;
677  void SetFrame(Frame const & in_frame);
678 
680  unsigned int GetLeaderLineCount() const;
687  void GetLeaderLines(unsigned int & out_count, Polyline out_leader_lines[]) const;
692  void SetLeaderLines(unsigned int in_count, Polyline const in_leader_lines[]);
693 
695  unsigned int GetLeaderSymbolCount() const;
702  void GetLeaderSymbols(unsigned int & out_count, Polygon out_leader_symbols[]) const;
707  void SetLeaderSymbols(unsigned int in_count, Polygon const * in_leader_symbols);
708 
709 
711  void SetDisplayParallelToScreen(bool const in_parallel = true);
713  bool IsDisplayParallelToScreen() const;
714 
715 
717  void GetDrawing(Drawing & out_drawing) const;
719  void SetDrawing(Drawing const & in_drawing);
720 
721 
722 protected:
723  PMII::PrivateImpl * impl_;
724 };
725 
726 
730 class MVO_API DatumEntity : public Entity
731 {
732 public:
735  DatumEntity(HC_KEY segment_key = INVALID_KEY);
736  DatumEntity(DatumEntity const & that);
737  virtual ~DatumEntity();
738 
739  void Set(DatumEntity const & that);
740  DatumEntity const & operator=(DatumEntity const & that);
741 
742  virtual Type GetType() const { return PMI::DatumType; };
743 
745  Datum::Type GetDatumType() const;
747  void SetDatumType(Datum::Type const in_type);
748 
749  /* \return the number of labels for this DatumEntity */
750  unsigned int GetLabelCount() const;
760  void GetLabels(unsigned int & out_count, String out_labels[], TextAttributes out_text_attributes[]) const;
766  void SetLabels(unsigned int in_count, String const in_labels[], TextAttributes const in_text_attributes[]);
767 };
768 
769 
773 class MVO_API DimensionEntity : public Entity
774 {
775 public:
778  DimensionEntity(HC_KEY segment_key = INVALID_KEY);
779  DimensionEntity(DimensionEntity const & that);
780  virtual ~DimensionEntity();
781 
782  void Set(DimensionEntity const & that);
783  DimensionEntity const & operator=(DimensionEntity const & that);
784 
785  virtual Type GetType() const { return PMI::DimensionType; };
786 
788  Dimension::Type GetDimensionType() const;
790  void SetDimensionType(Dimension::Type const in_type);
791 
793  Dimension::SubType GetDimensionSubType() const;
795  void SetDimensionSubType(Dimension::SubType const in_sub_type);
796 
798  unsigned int GetStringCount() const;
808  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
814  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
815 };
816 
817 
821 class MVO_API FeatureControlFrameEntity : public Entity
822 {
823 public:
826  FeatureControlFrameEntity(HC_KEY segment_key = INVALID_KEY);
828  virtual ~FeatureControlFrameEntity();
829 
830  void Set(FeatureControlFrameEntity const & that);
831  FeatureControlFrameEntity const & operator=(FeatureControlFrameEntity const & that);
832 
833  virtual Type GetType() const { return PMI::FeatureControlFrameType; };
834 
840  void GetToleranceType(Tolerance::Type & out_tolerance_type, TextAttributes & out_text_attributes) const;
845  void SetToleranceType(Tolerance::Type const in_tolerance_type, TextAttributes const & in_text_attributes);
846 
852  void GetDiameterModifierType(DiameterModifier::Type & out_diameter_modifier_type, TextAttributes & out_text_attributes) const;
857  void SetDiameterModifierType(DiameterModifier::Type const in_diameter_modifier_type, TextAttributes const & in_text_attributes);
858 
864  void GetZoneToleranceMagnitude(String & out_zone_tolerance_magnitude, TextAttributes & out_text_attributes) const;
870  void SetZoneToleranceMagnitude(String const & in_zone_tolerance_magnitude, TextAttributes const & in_text_attributes);
871 
877  void GetFirstZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
883  void SetFirstZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
884 
890  void GetSecondZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
896  void SetSecondZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
897 
903  void GetProjectedMagnitude(String & out_projected_magnitude, TextAttributes & out_text_attributes) const;
909  void SetProjectedMagnitude(String const & in_projected_magnitude, TextAttributes const & in_text_attributes);
910 
912  unsigned int GetDatumReferenceCount() const;
926  void GetDatumReferences(unsigned int & out_count, String out_labels[], TextAttributes out_label_attributes[],
927  DatumModifier::Type out_modifiers[], TextAttributes out_modifier_attributes[]);
935  void SetDatumReferences(unsigned int in_count, String const in_labels[], TextAttributes const in_label_attributes[],
936  DatumModifier::Type const in_modifiers[], TextAttributes const in_modifier_attributes[]);
937 };
938 
939 
943 class MVO_API GenericEntity : public Entity
944 {
945 public:
948  GenericEntity(HC_KEY segment_key = INVALID_KEY);
949  GenericEntity(GenericEntity const & that);
950  virtual ~GenericEntity();
951 
952  void Set(GenericEntity const & that);
953  GenericEntity const & operator=(GenericEntity const & that);
954 
955  virtual Type GetType() const { return PMI::GenericType; };
956 
958  unsigned int GetStringCount() const;
968  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
974  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
975 
976 
980  void SetDisplayParallelToScreen(bool const in_parallel = true);
984  bool IsDisplayParallelToScreen() const;
985 
986 };
987 
988 
992 class MVO_API NoteEntity : public Entity
993 {
994 public:
997  NoteEntity(HC_KEY segment_key = INVALID_KEY);
998  NoteEntity(NoteEntity const & that);
999  virtual ~NoteEntity();
1000 
1001  void Set(NoteEntity const & that);
1002  NoteEntity const & operator=(NoteEntity const & that);
1003 
1004  virtual Type GetType() const { return PMI::NoteType; };
1005 
1007  unsigned int GetStringCount() const;
1017  void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
1023  void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
1024 };
1025 
1026 
1030 class MVO_API RoughnessEntity : public Entity
1031 {
1032 public:
1035  RoughnessEntity(HC_KEY segment_key = INVALID_KEY);
1036  RoughnessEntity(RoughnessEntity const & that);
1037  virtual ~RoughnessEntity();
1038 
1039  void Set(RoughnessEntity const & that);
1040  RoughnessEntity const & operator=(RoughnessEntity const & that);
1041 
1042  virtual Type GetType() const { return PMI::RoughnessType; };
1043 
1045  Roughness::Obtention::Type GetObtentionType() const;
1047  void SetObtentionType(Roughness::Obtention::Type const in_obtention_type);
1048 
1050  Roughness::Applicability::Type GetApplicabilityType() const;
1052  void SetApplicabilityType(Roughness::Applicability::Type const in_applicability_type);
1053 
1055  Roughness::Mode::Type GetModeType() const;
1057  void SetModeType(Roughness::Mode::Type const in_mode_type);
1058 
1060  unsigned int GetFieldCount() const;
1070  void GetFields(unsigned int & out_count, String out_fields[], TextAttributes out_text_attributes[]) const;
1076  void SetFields(unsigned int in_count, String const in_fields[], TextAttributes const in_text_attributes[]);
1077 };
1078 
1079 
1083 class MVO_API ViewEntity
1084 {
1085 public:
1088  ViewEntity(HC_KEY segment_key = INVALID_KEY);
1089  ViewEntity(ViewEntity const & that);
1090  virtual ~ViewEntity();
1091 
1092  void Set(ViewEntity const & that);
1093  ViewEntity const & operator=(ViewEntity const & that);
1094 
1096  void GetCamera(Camera & out_camera) const;
1098  void GetCamera(Point & out_position, Point & out_target, Point & out_up_vector, float & out_field_width, float & out_field_height,
1099  char out_projection[128]);
1101  void GetCamera(float out_position[3], float out_target[3], float out_up_vector[3], float & out_field_width, float & out_field_height,
1102  char out_projection[128]);
1104  void SetCamera(Camera const & in_camera);
1106  void SetCamera(Point const & in_position, Point const & in_target, Point const & in_up_vector, float in_field_width,
1107  float in_field_height, char const in_projection[128]);
1109  void SetCamera(float const in_position[3], float const in_target[3], float const in_up_vector[3], float in_field_width,
1110  float in_field_height, char const in_projection[128]);
1111 
1113  void GetFrame(Frame & out_frame) const;
1115  void SetFrame(Frame const & in_frame);
1116 
1118  void GetName(String & out_name) const;
1120  void SetName(String const & in_name);
1121 
1123  unsigned int GetAssociatedEntityCount() const;
1130  void GetAssociatedEntities(unsigned int & out_count, Entity out_entities[]) const;
1135  void SetAssociatedEntities(unsigned int in_count, Entity const in_entities[]);
1136 
1137 protected:
1138  PMII::PrivateImpl * impl_;
1139 };
1140 
1141 // ====================== end actual entities =======================
1142 
1143 
1144 }; // PMI
1145 
1146 #ifdef H_PACK_8
1147 #pragma pack(pop)
1148 #endif
1149 
1150 #endif // _HUTILITYPMI_H
Definition: HUtilityPMI.h:656
Definition: HUtilityPMI.h:586
Definition: HUtilityPMI.h:992
virtual Type GetType() const
Definition: HUtilityPMI.h:669
virtual Type GetType() const
Definition: HUtilityPMI.h:785
#define HC_KEY
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:543
Definition: HUtilityPMI.h:269
Definition: HDWFMisc.h:22
Definition: HUtilityPMI.h:301
virtual Type GetType() const
Definition: HUtilityPMI.h:1004
virtual Type GetType() const
Definition: HUtilityPMI.h:1042
Definition: HUtilityPMI.h:821
Definition: HUtilityPMI.h:455
Definition: HUtilityPMI.h:397
Definition: HUtilityPMI.h:1030
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
Type
Definition: HUtilityPMI.h:45
Definition: HUtilityPMI.h:338
Definition: HUtilityPMI.h:508
Definition: HUtilityPMI.h:1083
Definition: HDGNHelper.h:450
Definition: HUtilityPMI.h:773
Definition: HUtilityPMI.h:943
Definition: HUtilityPMI.h:730
Definition: HUtilityPMI.h:618
virtual Type GetType() const
Definition: HUtilityPMI.h:833
virtual Type GetType() const
Definition: HUtilityPMI.h:742
virtual Type GetType() const
Definition: HUtilityPMI.h:955