Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityPMI.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 #ifndef _HUTILITYPMI_H
00011 #define _HUTILITYPMI_H
00012 
00013 #include "hc.h"
00014 
00015 #include "HTools.h"
00016 #include "HGlobals.h"
00017 #include "HUtility.h"
00018 
00019 #ifdef H_PACK_8
00020 #pragma pack(push)
00021 #pragma pack(8)
00022 #endif
00023 
00024 namespace PMII
00025 {
00026     class PrivateImpl;
00027 };
00028 
00032 namespace PMI 
00033 {
00034 
00035 // ======================= start enums =======================
00036 
00040 enum Type
00041 {
00042     UnknownType,
00043     DatumType,
00044     DimensionType,
00045     FeatureControlFrameType,
00046     GenericType,
00047     NoteType,
00048     RoughnessType
00049 };
00050 
00054 namespace Datum
00055 {
00059     enum Type
00060     {
00061         Unknown,
00062         Identifier,
00063         Target
00064     };
00065 };
00066 
00070 namespace Tolerance
00071 {
00075     enum Type
00076     {
00077         Unknown,
00078         Angularity,
00079         Circularity,
00080         CircularRunout,
00081         Concentricity,
00082         Cylindricity,
00083         Flatness,
00084         LineProfile,
00085         Parallelism,
00086         Perpendicularity,
00087         Position,
00088         Straightness,
00089         SurfaceProfile,
00090         Symmetry,
00091         TotalRunout
00092     };
00093 };
00094 
00098 namespace ZoneModifier
00099 {
00103     enum Type
00104     {
00105         None,
00106         MaximumMaterialCondition,
00107         LeastMaterialCondition,
00108         RegardlessOfFeatureSize,
00109         TangentPlane,
00110         ProjectedToleranceZone,
00111         FreeState,
00112         StatisticalTolerance
00113     };
00114 };
00115 
00119 namespace DatumModifier
00120 {
00124     enum Type
00125     {
00126         None,
00127         MaximumMaterialCondition,
00128         LeastMaterialCondition,
00129         RegardlessOfFeatureSize
00130     };
00131 };
00132 
00136 namespace DiameterModifier
00137 {
00141     enum Type
00142     {
00143         None,
00144         Diameter,
00145         SphericalDiameter
00146     };
00147 };
00148 
00152 namespace Dimension
00153 {
00157     enum Type
00158     {
00159         UnknownType,
00160         BasicType,
00161         ReferenceType,
00162         ToleranceType
00163     };
00164 
00168     enum SubType
00169     {
00170         UnknownSubType,
00171         AngleSubType,
00172         ChamferSubType,
00173         DiameterSubType,
00174         DistanceSubType,
00175         LengthSubType,
00176         RadiusSubType,
00177         SlopeSubType
00178     };
00179 };
00180 
00184 namespace Roughness
00185 {
00189     namespace Obtention
00190     {
00194         enum Type
00195         {
00196             Unknown,
00197             NotDefined,
00198             MachiningMandatory,
00199             MachiningForbidden
00200         };
00201     };
00202 
00206     namespace Applicability
00207     {
00211         enum Type
00212         {
00213             Unknown,
00214             SpecifiedSurface,
00215             SurroundingSurfaces,
00216             BasicSurface,
00217             AllSurfaces
00218         };
00219     };
00220 
00224     namespace Mode
00225     {
00229         enum Type
00230         {
00231             Unknown,
00232             None,
00233             MultiDirectional,
00234             Circular,
00235             Radial,
00236             Particular,
00237             WithAngles,
00238             Parallel,
00239             Perpendicular
00240         };
00241     };
00242 };
00243 
00244 // ======================= end enums =======================
00245 
00246 
00247 // ======================= start common classes =======================
00248 
00249 class Frame;
00250 class LeaderLine;
00251 class Orientation;
00252 class Polyline;
00253 class TextAttributes;
00254 class Polygon;
00255 
00256 typedef HPoint Point;
00257 typedef HPoint RGBColor;
00258 typedef HCamera Camera;
00259 
00260 
00264 class MVO_API Frame
00265 {
00266 public:
00267     Frame();
00268     Frame(Frame const & that);
00269     ~Frame();
00270 
00271     void Set(Frame const & that);
00272     Frame const & operator=(Frame const & that);
00273 
00275     unsigned int GetPolylineCount() const;
00282     void GetPolylines(unsigned int & out_count, Polyline out_polylines[]) const;
00287     void SetPolylines(unsigned int in_count, Polyline const in_polylines[]);
00288 
00289 private:
00290     PMII::PrivateImpl * impl_;
00291 };
00292 
00296 class MVO_API Drawing
00297 {
00298 public:
00299     Drawing();
00300     Drawing(Drawing const & that);
00301     ~Drawing();
00302 
00303     void Set(Drawing const & that);
00304     Drawing const & operator=(Drawing const & that);
00305 
00307     unsigned int GetPolygonCount() const;
00314     void GetPolygons(unsigned int & out_count, Polygon out_polygons[]) const;
00319     void SetPolygons(unsigned int in_count, Polygon const in_polygons[]);
00320 
00321 private:
00322     PMII::PrivateImpl * impl_;
00323 };
00324 
00325 
00333 class MVO_API Orientation
00334 {
00335 public:
00336     Orientation();
00337     Orientation(Orientation const & that);
00338     ~Orientation();
00339 
00340     void Set(Orientation const & that);
00341     Orientation const & operator=(Orientation const & that);
00342 
00344     void GetXComponent(Point & out_component) const;
00346     void GetXComponent(float & out_x, float & out_y, float & out_z) const;
00348     void SetXComponent(Point const & in_component);
00350     void SetXComponent(float in_x, float in_y, float in_z);
00351 
00353     void GetYComponent(Point & out_component) const;
00355     void GetYComponent(float & out_x, float & out_y, float & out_z) const;
00357     void SetYComponent(Point const & in_component);
00359     void SetYComponent(float in_x, float in_y, float in_z);
00360 
00362     void GetZComponent(Point & out_component) const;
00364     void GetZComponent(float & out_x, float & out_y, float & out_z) const;
00366     void SetZComponent(Point const & in_component);
00368     void SetZComponent(float in_x, float in_y, float in_z);
00369 
00371     void GetOriginComponent(Point & out_component) const;
00373     void GetOriginComponent(float & out_x, float & out_y, float & out_z) const;
00375     void SetOriginComponent(Point const & in_component);
00377     void SetOriginComponent(float in_x, float in_y, float in_z);
00378 
00380     void GetMatrix(float out_matrix[16]) const;
00382     void SetMatrix(float const in_matrix[16]);
00383 
00384 private:
00385     PMII::PrivateImpl * impl_;
00386 };
00387 
00388 
00392 class MVO_API Polyline
00393 {
00394 public:
00395     Polyline();
00396     Polyline(Polyline const & that);
00397     ~Polyline();
00398 
00399     void Set(Polyline const & that);
00400     Polyline const & operator=(Polyline const & that);
00401 
00403     void GetRGBColor(RGBColor & out_color) const;
00405     void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
00407     void SetRGBColor(RGBColor const & in_color);
00409     void SetRGBColor(float const in_r, float const in_g, float const in_b);
00410 
00412     void GetLinePattern(char out_pattern[1024]) const;
00414     void SetLinePattern(char const in_pattern[1024]);
00415 
00417     unsigned int GetPointCount() const;
00424     void GetPoints(unsigned int & out_count, Point out_points[]) const;
00431     void GetPoints(unsigned int & out_count, float out_points[]) const;
00436     void SetPoints(unsigned int in_count, Point const in_points[]);
00441     void SetPoints(unsigned int in_count, float const in_points[]);
00442 
00443 private:
00444     PMII::PrivateImpl * impl_;
00445 };
00446 
00450 class MVO_API Polygon
00451 {
00452 public:
00453     Polygon();
00454     Polygon(Polygon const & that);
00455     ~Polygon();
00456 
00457     void Set(Polygon const & that);
00458     Polygon const & operator=(Polygon const & that);
00459 
00461     void GetRGBColor(RGBColor & out_color) const;
00463     void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
00465     void SetRGBColor(RGBColor const & in_color);
00467     void SetRGBColor(float const in_r, float const in_g, float const in_b);
00468 
00470     unsigned int GetPointCount() const;
00477     void GetPoints(unsigned int & out_count, Point out_points[]) const;
00484     void GetPoints(unsigned int & out_count, float out_points[]) const;
00489     void SetPoints(unsigned int in_count, Point const in_points[]);
00494     void SetPoints(unsigned int in_count, float const in_points[]);
00495 
00496 private:
00497     PMII::PrivateImpl * impl_;
00498 };
00499 
00503 class MVO_API TextAttributes
00504 {
00505 public:
00506     TextAttributes();
00507     TextAttributes(TextAttributes const & that);
00508     ~TextAttributes();
00509 
00510     void Set(TextAttributes const & that);
00511     TextAttributes const & operator=(TextAttributes const & that);
00512 
00514     void GetInsertionPoint(Point & out_point) const;
00516     void GetInsertionPoint(float & out_x, float & out_y, float & out_z) const;
00518     void SetInsertionPoint(Point const & in_point);
00520     void SetInsertionPoint(float in_x, float in_y, float in_z);
00521 
00523     void GetFontSize(float & out_size) const;
00525     void SetFontSize(float const in_size);
00526 
00528     void GetFontName(char * out_font_name) const;
00530     void SetFontName(char const * in_font_name);
00531 
00533     void GetOrientation(Orientation & out_orientation) const;
00535     void SetOrientation(Orientation const & in_orientation);
00536 
00538     void GetRGBColor(RGBColor & out_color) const;
00540     void GetRGBColor(float & out_r, float & out_g, float & out_b) const;
00542     void SetRGBColor(RGBColor const & in_color);
00544     void SetRGBColor(float in_r, float in_g, float in_b);
00545 
00546     
00548     bool IsBold() const;
00550     bool IsItalic() const;
00552     bool IsUnderlined() const;
00554     bool IsStrikedThrough() const;
00556     bool IsOverlined() const;
00558     bool IsStreched() const;
00560     bool IsWired() const;
00562     bool IsFixedWidth() const;
00564     void SetFormat(char const & in_format);
00565     
00567     double WidthScale() const;
00569     void SetWidthScale(const double width_scale);
00570 
00571 private:
00572     PMII::PrivateImpl * impl_;
00573 };
00574 
00575 
00581 class MVO_API String
00582 {
00583 public:
00584     String();
00585     String(char const * cstring);
00586     String(wchar_t const * wstring);
00587     String(H_WCS const & wcs);
00588     String(H_UTF8 const & utf8);
00589     String(String const & that);
00590     ~String();
00591 
00592     void Set(String const & in_that);
00593     String const & operator=(String const & in_that);
00594 
00596     char const * CStr() const;
00598     wchar_t const * WStr() const;
00600     size_t  WLength() const;
00601 
00602     bool Equals(String const & in_that) const;
00603     bool operator==(String const & in_that) const;
00604     bool operator!=(String const & in_that) const;
00605 
00606 private:
00607     PMII::PrivateImpl * impl_;
00608 };
00609 
00613 class MVO_API Options
00614 {
00615 public:
00616     Options();
00617     Options(Options const & that);
00618     ~Options();
00619 
00620     void Set(Options const & that);
00621     Options const & operator=(Options const & that);
00622 
00624     void SetDisplayParallelToScreen(bool const in_parallel  = true);
00626     bool IsDisplayParallelToScreen() const;
00627 
00628 private:
00629     PMII::PrivateImpl * impl_;
00630 };
00631 // ======================= end common classes =======================
00632 
00633 
00634 // ====================== start actual entities =======================
00635 
00636 class Entity;
00637 class DatumEntity;
00638 class DimensionEntity;
00639 class FeatureControlFrameEntity;
00640 class GenericEntity;
00641 class GeometricToleranceEntity;
00642 class NoteEntity;
00643 class RoughnessEntity;
00644 class ViewEntity;
00645 
00646 
00651 class MVO_API Entity
00652 {
00653 public:
00656     Entity(HC_KEY segment_key = INVALID_KEY);
00657     Entity(Entity const & that);
00658     virtual ~Entity(); 
00659 
00660     void Set(Entity const & that);
00661     Entity const & operator=(Entity const & that);
00662 
00664     virtual Type GetType() const { return PMI::UnknownType; };
00665 
00667     HC_KEY GetSegmentKey() const;
00668 
00670     void GetFrame(Frame & out_frame) const;
00672     void SetFrame(Frame const & in_frame);
00673 
00675     unsigned int GetLeaderLineCount() const;
00682     void GetLeaderLines(unsigned int & out_count, Polyline out_leader_lines[]) const;
00687     void SetLeaderLines(unsigned int in_count, Polyline const in_leader_lines[]);
00688 
00690     unsigned int GetLeaderSymbolCount() const;
00697     void GetLeaderSymbols(unsigned int & out_count, Polygon out_leader_symbols[]) const;
00702     void SetLeaderSymbols(unsigned int in_count, Polygon const in_leader_symbols[]);
00703 
00704 
00706     void SetDisplayParallelToScreen(bool const in_parallel = true);
00708     bool IsDisplayParallelToScreen() const;
00709 
00710 
00712     void GetDrawing(Drawing & out_drawing) const;
00714     void SetDrawing(Drawing const & in_drawing);
00715 
00716 
00717 protected:
00718     PMII::PrivateImpl * impl_;
00719 };
00720 
00721 
00725 class MVO_API DatumEntity : public Entity
00726 {
00727 public:
00730     DatumEntity(HC_KEY segment_key = INVALID_KEY);
00731     DatumEntity(DatumEntity const & that);
00732     virtual ~DatumEntity(); 
00733 
00734     void Set(DatumEntity const & that);
00735     DatumEntity const & operator=(DatumEntity const & that);
00736 
00737     virtual Type GetType() const { return PMI::DatumType; };
00738     
00740     Datum::Type GetDatumType() const;
00742     void SetDatumType(Datum::Type const in_type);
00743 
00744     /* \return the number of labels for this DatumEntity */
00745     unsigned int GetLabelCount() const;
00755     void GetLabels(unsigned int & out_count, String out_labels[], TextAttributes out_text_attributes[]) const;
00761     void SetLabels(unsigned int in_count, String const in_labels[], TextAttributes const in_text_attributes[]);
00762 };
00763 
00764 
00768 class MVO_API DimensionEntity : public Entity
00769 {
00770 public:
00773     DimensionEntity(HC_KEY segment_key = INVALID_KEY);
00774     DimensionEntity(DimensionEntity const & that);
00775     virtual ~DimensionEntity(); 
00776 
00777     void Set(DimensionEntity const & that);
00778     DimensionEntity const & operator=(DimensionEntity const & that);
00779     
00780     virtual Type GetType() const { return PMI::DimensionType; };
00781 
00783     Dimension::Type GetDimensionType() const;
00785     void SetDimensionType(Dimension::Type const in_type);
00786 
00788     Dimension::SubType GetDimensionSubType() const;
00790     void SetDimensionSubType(Dimension::SubType const in_sub_type);
00791 
00793     unsigned int GetStringCount() const;
00803     void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
00809     void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
00810 };
00811 
00812 
00816 class MVO_API FeatureControlFrameEntity : public Entity
00817 {
00818 public:
00821     FeatureControlFrameEntity(HC_KEY segment_key = INVALID_KEY);
00822     FeatureControlFrameEntity(FeatureControlFrameEntity const & that);
00823     virtual ~FeatureControlFrameEntity();
00824 
00825     void Set(FeatureControlFrameEntity const & that);
00826     FeatureControlFrameEntity const & operator=(FeatureControlFrameEntity const & that);
00827 
00828     virtual Type GetType() const { return PMI::FeatureControlFrameType; };
00829 
00835     void GetToleranceType(Tolerance::Type & out_tolerance_type, TextAttributes & out_text_attributes) const;
00840     void SetToleranceType(Tolerance::Type const in_tolerance_type, TextAttributes const & in_text_attributes);
00841 
00847     void GetDiameterModifierType(DiameterModifier::Type & out_diameter_modifier_type, TextAttributes & out_text_attributes) const;
00852     void SetDiameterModifierType(DiameterModifier::Type const in_diameter_modifier_type, TextAttributes const & in_text_attributes);
00853 
00859     void GetZoneToleranceMagnitude(String & out_zone_tolerance_magnitude, TextAttributes & out_text_attributes) const;
00865     void SetZoneToleranceMagnitude(String const & in_zone_tolerance_magnitude, TextAttributes const & in_text_attributes);
00866 
00872     void GetFirstZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
00878     void SetFirstZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
00879 
00885     void GetSecondZoneModifierType(ZoneModifier::Type & out_zone_modifier_type, TextAttributes & out_text_attributes) const;
00891     void SetSecondZoneModifierType(ZoneModifier::Type const in_zone_modifier_type, TextAttributes const & in_text_attributes);
00892 
00898     void GetProjectedMagnitude(String & out_projected_magnitude, TextAttributes & out_text_attributes) const;
00904     void SetProjectedMagnitude(String const & in_projected_magnitude, TextAttributes const & in_text_attributes);
00905 
00907     unsigned int GetDatumReferenceCount() const;
00921     void GetDatumReferences(unsigned int & out_count, String out_labels[], TextAttributes out_label_attributes[],
00922                             DatumModifier::Type out_modifiers[], TextAttributes out_modifier_attributes[]);
00930     void SetDatumReferences(unsigned int in_count, String const in_labels[], TextAttributes const in_label_attributes[],
00931                             DatumModifier::Type const in_modifiers[], TextAttributes const in_modifier_attributes[]);
00932 };
00933 
00934 
00938 class MVO_API GenericEntity : public Entity
00939 {
00940 public:
00943     GenericEntity(HC_KEY segment_key = INVALID_KEY);
00944     GenericEntity(GenericEntity const & that);
00945     virtual ~GenericEntity();
00946 
00947     void Set(GenericEntity const & that);
00948     GenericEntity const & operator=(GenericEntity const & that);
00949 
00950     virtual Type GetType() const { return PMI::GenericType; };
00951 
00953     unsigned int GetStringCount() const;
00963     void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
00969     void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
00970 
00971 
00975     void SetDisplayParallelToScreen(bool const in_parallel = true);
00979     bool IsDisplayParallelToScreen() const;
00980 
00981 };
00982 
00983 
00987 class MVO_API NoteEntity : public Entity
00988 {
00989 public:
00992     NoteEntity(HC_KEY segment_key = INVALID_KEY);
00993     NoteEntity(NoteEntity const & that);
00994     virtual ~NoteEntity();
00995 
00996     void Set(NoteEntity const & that);
00997     NoteEntity const & operator=(NoteEntity const & that);
00998 
00999     virtual Type GetType() const { return PMI::NoteType; };
01000 
01002     unsigned int GetStringCount() const;
01012     void GetStrings(unsigned int & out_count, String out_strings[], TextAttributes out_text_attributes[]) const;
01018     void SetStrings(unsigned int in_count, String const in_strings[], TextAttributes const in_text_attributes[]);
01019 };
01020 
01021 
01025 class MVO_API RoughnessEntity : public Entity
01026 {
01027 public:
01030     RoughnessEntity(HC_KEY segment_key = INVALID_KEY);
01031     RoughnessEntity(RoughnessEntity const & that);
01032     virtual ~RoughnessEntity();
01033 
01034     void Set(RoughnessEntity const & that);
01035     RoughnessEntity const & operator=(RoughnessEntity const & that);
01036     
01037     virtual Type GetType() const { return PMI::RoughnessType; };
01038 
01040     Roughness::Obtention::Type GetObtentionType() const;
01042     void SetObtentionType(Roughness::Obtention::Type const in_obtention_type);
01043 
01045     Roughness::Applicability::Type GetApplicabilityType() const;
01047     void SetApplicabilityType(Roughness::Applicability::Type const in_applicability_type);
01048 
01050     Roughness::Mode::Type GetModeType() const;
01052     void SetModeType(Roughness::Mode::Type const in_mode_type);
01053 
01055     unsigned int GetFieldCount() const;
01065     void GetFields(unsigned int & out_count, String out_fields[], TextAttributes out_text_attributes[]) const;
01071     void SetFields(unsigned int in_count, String const in_fields[], TextAttributes const in_text_attributes[]);
01072 };
01073 
01074 
01078 class MVO_API ViewEntity
01079 {
01080 public:
01083     ViewEntity(HC_KEY segment_key = INVALID_KEY);
01084     ViewEntity(ViewEntity const & that);
01085     virtual ~ViewEntity();
01086 
01087     void Set(ViewEntity const & that);
01088     ViewEntity const & operator=(ViewEntity const & that);
01089 
01091     void GetCamera(Camera & out_camera) const;
01093     void GetCamera(Point & out_position, Point & out_target, Point & out_up_vector, float & out_field_width, float & out_field_height,
01094             char out_projection[128]);
01096     void GetCamera(float out_position[3], float out_target[3], float out_up_vector[3], float & out_field_width, float & out_field_height,
01097             char out_projection[128]);
01099     void SetCamera(Camera const & in_camera);
01101     void SetCamera(Point const & in_position, Point const & in_target, Point const & in_up_vector, float in_field_width,
01102             float in_field_height, char const in_projection[128]);
01104     void SetCamera(float const in_position[3], float const in_target[3], float const in_up_vector[3], float in_field_width,
01105             float in_field_height, char const in_projection[128]);
01106 
01108     void GetFrame(Frame & out_frame) const;
01110     void SetFrame(Frame const & in_frame);
01111 
01113     void GetName(String & out_name) const;
01115     void SetName(String const & in_name);
01116 
01118     unsigned int GetAssociatedEntityCount() const;
01125     void GetAssociatedEntities(unsigned int & out_count, Entity out_entities[]) const;
01130     void SetAssociatedEntities(unsigned int in_count, Entity const in_entities[]);
01131 
01132 protected:
01133     PMII::PrivateImpl * impl_;
01134 };
01135 
01136 // ====================== end actual entities =======================
01137 
01138 
01139 }; // PMI
01140 
01141 #ifdef H_PACK_8
01142 #pragma pack(pop)
01143 #endif
01144 
01145 #endif // _HUTILITYPMI_H