opennurbs_annotation2.h
Go to the documentation of this file.
00001 /* $NoKeywords: $ */
00002 /*
00003 //
00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
00006 // McNeel & Associates.
00007 //
00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
00011 //                              
00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
00013 //
00015 */
00016 
00017 #ifndef OPENNURBS_ANNOTATION2_H_INC
00018 #define OPENNURBS_ANNOTATION2_H_INC
00019 
00020 #if defined(ON_OS_WINDOWS_GDI)
00021 
00022 #define ON_RECT RECT
00023 
00024 #else
00025 
00026 typedef struct tagON_RECT
00027 {
00028   int left;
00029   int top;
00030   int right;
00031   int bottom;
00032 } ON_RECT;
00033 
00034 #endif
00035 
00036 
00037 class ON_CLASS ON_Annotation2Text : public ON_wString
00038 {
00039 public:
00040   ON_Annotation2Text();
00041   ~ON_Annotation2Text();
00042 
00043   // 24 Sep 2010 Dale Lear
00044   //    None of these were implmented and they don't make any sense.
00045   //    ON_Annotation2Text is derived from ON_wString, not ON_Object.
00046   //    I'm commenting out these functions and it doesn't break the
00047   //    SDK because linking would fail for anybody trying to use
00048   //    these functions.
00049 
00063 
00064 
00065 
00066   ON_Annotation2Text& operator=(const char*);
00067   ON_Annotation2Text& operator=(const wchar_t*);
00068 
00069   void SetText( const char* s );
00070   void SetText( const wchar_t* s );
00071 
00072   // m_rect is a Windows gdi RECT that bounds text 
00073   // ("x" increases to the right and "y" increases downwards).
00074   // If all fields are 0, then m_rect is not set.
00075   // If left < right and top < bottom, then the rect bounds 
00076   // the text when it is drawn with its font's 
00077   // lfHeight=ON_Font::normal_font_height and (0,0) left baseline
00078   // point of the leftmost character on the first line
00079   // of text. If (x,y) is a point on the drawn text, then
00080   // left <= x < right and top <= y < bottom.
00081   ON_RECT m_rect;
00082 };
00083 
00084 // Extension to ON_TextEntity added 12/10/2009 for Text background drawing
00085 class ON_CLASS ON_TextExtra : public ON_UserData
00086 {
00087   ON_OBJECT_DECLARE(ON_TextExtra);
00088 public:
00089 
00090   ON_TextExtra();
00091   ~ON_TextExtra();
00092 
00093   static
00094   ON_TextExtra* TextExtension(class ON_TextEntity2* pDim, bool bCreate);
00095   static const 
00096   ON_TextExtra* TextExtension(const class ON_TextEntity2* pDim, bool bCreate);
00097 
00098   void SetDefaults();
00099 
00100   // override virtual ON_Object::Dump function
00101   void Dump( ON_TextLog& text_log ) const;
00102 
00103   // override virtual ON_Object::Dump function
00104   unsigned int SizeOf() const;
00105 
00106   // override virtual ON_Object::Write function
00107   ON_BOOL32 Write(ON_BinaryArchive& binary_archive) const;
00108 
00109   // override virtual ON_Object::Read function
00110   ON_BOOL32 Read(ON_BinaryArchive& binary_archive);
00111 
00112   // override virtual ON_UserData::GetDescription function
00113   ON_BOOL32 GetDescription( ON_wString& description );
00114 
00115   // override virtual ON_UserData::Archive function
00116   ON_BOOL32 Archive() const; 
00117 
00118   ON_UUID ParentUUID() const;
00119   void SetParentUUID( ON_UUID parent_uuid);
00120 
00121   bool DrawTextMask() const;
00122   void SetDrawTextMask(bool bDraw);
00123 
00124   int MaskColorSource() const;
00125   void SetMaskColorSource(int source);
00126 
00127   ON_Color MaskColor() const;  // Only works right if MaskColorSource returns 2.
00128                                // Does not return viewport background color
00129   void SetMaskColor(ON_Color color);
00130 
00131   double MaskOffsetFactor() const;
00132   void SetMaskOffsetFactor(double offset);
00133 
00134   ON_UUID  m_parent_uuid;    // uuid of the text using this extension
00135 
00136   bool     m_bDrawMask;      // do or don't draw a mask
00137 
00138   int      m_color_source;   // 0: Use background color from viewport
00139                              // 1: Use specific color from m_mask_color
00140 
00141   ON_Color m_mask_color;     // Color to use for mask if m_color_source is 2
00142 
00143   double   m_border_offset;  // Offset for the border around text to the rectangle used to draw the mask
00144                              // This number * HeightOfI for the text is the offset on each side of the 
00145                              // tight rectangle around the text characters to the mask rectangle.
00146 };
00147 
00148 
00149 class ON_CLASS ON_DimensionExtra : public ON_UserData
00150 {
00151   ON_OBJECT_DECLARE(ON_DimensionExtra);
00152 public:
00153 
00154   ON_DimensionExtra();
00155   ~ON_DimensionExtra();
00156 
00157   static
00158   ON_DimensionExtra* DimensionExtension(class ON_LinearDimension2* pDim, bool bCreate);
00159   static const 
00160   ON_DimensionExtra* DimensionExtension(const class ON_LinearDimension2* pDim, bool bCreate);
00161   static
00162   ON_DimensionExtra* DimensionExtension(class ON_RadialDimension2* pDim, bool bCreate);
00163   static const 
00164   ON_DimensionExtra* DimensionExtension(const class ON_RadialDimension2* pDim, bool bCreate);
00165   static
00166   ON_DimensionExtra* DimensionExtension(class ON_OrdinateDimension2* pDim, bool bCreate);
00167   static const 
00168   ON_DimensionExtra* DimensionExtension(const class ON_OrdinateDimension2* pDim, bool bCreate);
00169 
00170   void SetDefaults();
00171 
00172   // override virtual ON_Object::Dump function
00173   void Dump( ON_TextLog& text_log ) const;
00174 
00175   // override virtual ON_Object::Dump function
00176   unsigned int SizeOf() const;
00177 
00178   // override virtual ON_Object::Write function
00179   ON_BOOL32 Write(ON_BinaryArchive& binary_archive) const;
00180 
00181   // override virtual ON_Object::Read function
00182   ON_BOOL32 Read(ON_BinaryArchive& binary_archive);
00183 
00184   // override virtual ON_UserData::GetDescription function
00185   ON_BOOL32 GetDescription( ON_wString& description );
00186 
00187   // override virtual ON_UserData::Archive function
00188   ON_BOOL32 Archive() const; 
00189 
00190   ON_UUID ParentUUID() const;
00191   void SetParentUUID( ON_UUID parent_uuid);
00192 
00193   //  0: default position
00194   //  1: force inside
00195   // -1: force outside
00196   int ArrowPosition() const;
00197   void SetArrowPosition( int position);
00198 
00199   // For a dimension in page space that measures between points in model space
00200   // of a detail view, this is the ratio of the page distance / model distance.
00201   // When the dimension text is displayed, the distance measured in model space
00202   // is multiplied by this number to get the value to display.
00203   double DistanceScale() const;
00204   void SetDistanceScale(double s);
00205 
00206   // Basepont in modelspace coordinates for ordinate dimensions
00207   void SetModelSpaceBasePoint(ON_3dPoint basepoint);
00208   ON_3dPoint ModelSpaceBasePoint() const;
00209 
00210   //const wchar_t* ToleranceUpperString() const;
00211   //ON_wString& ToleranceUpperString();
00212   //void SetToleranceUpperString( const wchar_t* upper_string);
00213   //void SetToleranceUpperString( ON_wString& upper_string);
00214 
00215   //const wchar_t* ToleranceLowerString() const;
00216   //ON_wString& ToleranceLowerString();
00217   //void SetToleranceLowerString( const wchar_t* lower_string);
00218   //void SetToleranceLowerString( ON_wString& lower_string);
00219 
00220   //const wchar_t* AlternateString() const;
00221   //ON_wString& AlternateString();
00222   //void SetAlternateString( const wchar_t* alt_string);
00223   //void SetAlternateString( ON_wString& alt_string);
00224 
00225   //const wchar_t* AlternateToleranceUpperString() const;
00226   //ON_wString& AlternateToleranceUpperString();
00227   //void SetAlternateToleranceUpperString( const wchar_t* upper_string);
00228   //void SetAlternateToleranceUpperString( ON_wString& upper_string);
00229 
00230   //const wchar_t* AlternateToleranceLowerString() const;
00231   //ON_wString& AlternateToleranceLowerString();
00232   //void SetAlternateToleranceLowerString( const wchar_t* lower_string);
00233   //void SetAlternateToleranceLowerString( ON_wString& lower_string);
00234 
00235   ON_UUID m_partent_uuid;  // the dimension using this extension
00236 
00237   int m_arrow_position;
00238 
00239   // This is either NULL or an array of GDI rects for the substrings 
00240   // that make up the dimension string.
00241   // If the dimension text is all on the same line, there is just one
00242   // rectangle needed to bound the text and that is the same as the
00243   // m_rect on the ON_Annotation2Text.
00244   // If the dimension has tolerances or for some other reason has more
00245   // than one line of text, m_text_rects is an array of 7 rects, one
00246   // each for the substrings that might be needed to display the dimension.
00247   // If some of the rects aren't used, they are empty at 0,0
00248   // The strings that correspond to these rectangles are generated from
00249   // info in the dimstyle
00250   ON_RECT* m_text_rects;
00251 
00252   double m_distance_scale;
00253   ON_3dPoint m_modelspace_basepoint;
00254 };
00255 
00256 
00257 /*
00258   class ON_Annotation2
00259 
00260     Description:
00261       Used to serialize definitions of annotation objects (dimensions, text, leaders, etc.).
00262       Virtual base class for annotation objects
00263       Replaces ON_Annotation
00264 */
00265 class ON_CLASS ON_Annotation2 : public ON_Geometry
00266 {
00267   ON_OBJECT_DECLARE(ON_Annotation2);
00268 
00269   // UNICODE symbol code to use for degrees, radius, diameter and plus/minus in dimensions
00270   enum SYMBOLS
00271   {
00272     degreesym = 176,
00273     radiussym = L'R',
00274     diametersym = 216,
00275     plusminussym = 177,
00276   };
00277 
00278 public:
00279   ON_Annotation2();
00280   ~ON_Annotation2();
00281   // C++ automatically provides the correct copy constructor and operator= .
00282   //ON_Annotation2(const ON_Annotation2&);
00283   //ON_Annotation2& operator=(const ON_Annotation2&);
00284 
00285   // convert from old style annotation
00286   ON_Annotation2(const ON_Annotation&);
00287   ON_Annotation2& operator=(const ON_Annotation&);
00288 
00289   // Description:
00290   //   Sets initial defaults
00291   void Create();
00292 
00293   void Destroy();
00294 
00295   void EmergencyDestroy();
00296 
00298   //
00299   // ON_Object overrides
00300   //
00301 
00302   ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const;
00303 
00304 
00305   /*
00306     Description: Writes the object to a file
00307 
00308     Returns:
00309       @untitled Table
00310       true     Success
00311       false    Failure
00312   */
00313   ON_BOOL32 Write(
00314          ON_BinaryArchive&
00315        ) const;
00316 
00317   /*
00318     Description: Reads the object from a file
00319 
00320     Returns:
00321       @untitled Table
00322       true     Success
00323       false    Failure
00324   */
00325   ON_BOOL32 Read(
00326          ON_BinaryArchive&
00327        );
00328 
00329   /*
00330     Returns: The Object Type of this object
00331   */
00332   ON::object_type ObjectType() const;
00333 
00335   //
00336   // ON_Geometry overrides
00337   //
00338 
00339   /*
00340     Returns the geometric dimension of the object ( usually 3)
00341   */
00342   int Dimension() const;
00343 
00344   // overrides virtual ON_Geometry::Transform()
00345   ON_BOOL32 Transform( const ON_Xform& xform );
00346 
00347   // virtual ON_Geometry override
00348   bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const;
00349 
00351   //
00352   // ON_Annotation2 interface
00353   //
00354 
00355   // Definitions of text justification
00356   // Not implemented on all annotation objects
00357   enum eTextJustification
00358   {
00359     tjUndefined = 0,
00360     tjLeft   = 1<<0,
00361     tjCenter = 1<<1,
00362     tjRight  = 1<<2,
00363     tjBottom = 1<<16,
00364     tjMiddle = 1<<17,
00365     tjTop    = 1<<18,
00366     tjBottomLeft   = tjBottom | tjLeft,
00367     tjBottomCenter = tjBottom | tjCenter,
00368     tjBottomRight  = tjBottom | tjRight,
00369     tjMiddleLeft   = tjMiddle | tjLeft,
00370     tjMiddleCenter = tjMiddle | tjCenter,
00371     tjMiddleRight  = tjMiddle | tjRight,
00372     tjTopLeft      = tjTop    | tjLeft,
00373     tjTopCenter    = tjTop    | tjCenter,
00374     tjTopRight     = tjTop    | tjRight,
00375   };
00376 
00377   /*
00378     Description:
00379       Query if the annotation object is a text object
00380     Parameters:
00381       none
00382     Returns:
00383       @untitled table
00384       true    It is text
00385       false   Its not text
00386   */
00387   bool IsText() const;
00388 
00389   /*
00390     Description:
00391       Query if the annotation object is a leader
00392     Parameters:
00393       none
00394     Returns:
00395       @untitled table
00396       true    It is a leader
00397       false   Its not a leader
00398   */
00399   bool IsLeader() const;
00400 
00401   /*
00402     Description:
00403       Query if the annotation object is a dimension
00404     Parameters:
00405       none
00406     Returns:
00407       @untitled table
00408       true    It is a dimension
00409       false   Its not a dimension
00410   */
00411   bool IsDimension() const;
00412 
00413   /*
00414     Description:
00415       Set or get the index in the appropriate table for either the font or
00416       dimstyle of this object
00417     Parameters:
00418       [in] int  the new index (Set)
00419     Returns:
00420       int -  The index (Get)
00421     Remarks:
00422       If the object is a text object the index is of object's font in the Font Table
00423       If the object is anything else, the index is of the object's dimstyle in the DimStyle Table
00424       Derived objects can use FontIndex() and StyleIndex() to set/get these same values.
00425   */
00426   int Index() const;
00427   void SetIndex( int);
00428 
00429   /*
00430   Returns:
00431     Dimension type
00432     Linear dim:  distance between arrow tips
00433     Radial dim:  radius or diameter depending on m_type value
00434     Angular dim: angle in degrees
00435     Leader:      ON_UNSET_VALUE
00436     Text:        ON_UNSET_VALUE
00437   */
00438   virtual 
00439   double NumericValue() const;
00440 
00441   /*
00442     Description:
00443       Set  or Get the height of the text in this annotation
00444     Parameters:
00445       [in] double new text height to set
00446     Returns:
00447       double Height of the text
00448     Remarks:
00449       Height is in model units
00450   */
00451   void SetHeight( double);
00452   double Height() const;
00453 
00454   /*
00455     Description:
00456       Sets or gets the object type member to a specific annotation type:
00457            dtDimLinear, dtDimAligned, dtDimAngular, etc.
00458     Parameters:
00459       [in] ON::eAnnotationType type - dtDimLinear, dtDimAligned, dtDimAngular, etc.
00460     Returns:
00461       ON::eAnnotationType of the object
00462   */
00463   void SetType( ON::eAnnotationType);
00464   ON::eAnnotationType Type() const;
00465 
00466   /*
00467     Description:
00468       Set or get the plane for the object's ECS
00469     Parameters:
00470       [in] ON_Plane& plane in WCS
00471     Returns:
00472       const ON_Plane& - the object's ECS plane in WCS coords
00473   */
00474   void SetPlane( const ON_Plane&);
00475   const ON_Plane& Plane() const;
00476 
00477   /*
00478     Description:
00479       Returns the number of definition points this object has
00480     Parameters:
00481       none
00482     Returns:
00483       @untitled table
00484       int   the object's point count
00485   */
00486   int PointCount() const;
00487   void SetPointCount( int count);
00488 
00489   /*
00490     Description:
00491       Set or get the object's whole points array at once
00492     Parameters:
00493       [in] ON_2dPointArray& pts
00494     Returns:
00495       const ON_2dPointArray& - ref to the object's point array
00496   */
00497   void SetPoints( const ON_2dPointArray&);
00498   const ON_2dPointArray& Points() const;
00499 
00500   /*
00501     Description:
00502       Set individual definition points for the annotation
00503     Parameters:
00504       @untitled table
00505       [in] int index               index of the point to set in ECS 2d coordinates
00506       [in] const ON_2dPoint& pt    the new point value
00507     Returns:
00508       ON_2dPoint   the point coordinates in ECS
00509   */
00510   void SetPoint( int, const ON_2dPoint&);
00511   ON_2dPoint Point( int) const;
00512 
00513   /*
00514     Description:
00515       
00516       Set or get the string value of the user text, with no substitution for "<>"
00517     Parameters:
00518       [in] const wchar_t* string   the new value for UserText
00519     Returns:
00520       const ON_wString&    The object's UserText
00521     Remarks:
00522       UserText is the string that gets printed when the dimensoin is drawn.
00523       If it contains the token "<>", that token is replaced with the measured
00524       value for the dimension, formatted according to the DimStyle settings.
00525       "<>" is the default for linear dimensions.
00526       Other dimensions include "<>" in their default string
00527   */
00528 
00529   // OBSOLETE - call SetTextValue( text_value );
00530   ON_DEPRECATED void SetUserText( const wchar_t* text_value );
00531 
00532   // OBSOLETE - call TextValue( text_value );
00533   ON_DEPRECATED const ON_wString& UserText() const;
00534 
00535 
00536   /*
00537   Description:
00538     Gets the value of the annotation text.
00539   Returns:
00540     Value of the annotation text.
00541   See Also:
00542     ON_Annotation2Text::SetTextValue()
00543     ON_Annotation2Text::SetTextFormula()
00544     ON_Annotation2Text::TextFormula()    
00545   Remarks:
00546     This gets the literal value of the text, there is no
00547     substitution for any "<>" substrings.  When a dimension
00548     is drawn, any occurance of "<>" will be replaced
00549     with the measured value for the dimension and formatted
00550     according to the DimStyle settings.
00551 
00552     Annotation text values can be constant or the result 
00553     of evaluating text formula containing %<...>% 
00554     expressions. The ...TextValue() functions set
00555     and get the text's value.  The ...TextFormula()
00556     functions get and set the text's formula.
00557   */
00558   const wchar_t* TextValue() const;
00559 
00560   /*
00561   Description:
00562     Sets the value of the annotation text.  No changes
00563     are made to the text_value string.
00564   Parameters:
00565     text_value - [in]
00566   Returns:
00567     Value of the annotation text.
00568   See Also:
00569     ON_Annotation2Text::SetTextFormula()
00570     ON_Annotation2Text::TextValue()    
00571     ON_Annotation2Text::TextFormula()    
00572   Remarks:
00573     Annotation text values can be constant or the result 
00574     of evaluating text formula containing %<...>% 
00575     expressions. The ...TextValue() functions set
00576     and get the text's value.  The ...TextFormula()
00577     functions get and set the text's formula.
00578   */
00579   void SetTextValue( const wchar_t* text_value );
00580 
00581   /*
00582   Description:
00583     Gets the formula for the annotation text.
00584   Parameters:
00585     text_value - [in]
00586   Returns:
00587     Value of the annotation text.
00588   See Also:
00589     ON_Annotation2Text::SetTextValue()
00590     ON_Annotation2Text::TextValue()    
00591     ON_Annotation2Text::TextFormula()    
00592   Remarks:
00593     Annotation text values can be constant or the result 
00594     of evaluating text formula containing %<...>% 
00595     expressions. The ...TextValue() functions set
00596     and get the text's value.  The ...TextFormula()
00597     functions get and set the text's formula.
00598   */
00599   const wchar_t* TextFormula() const;
00600 
00601   /*
00602   Description:
00603     Sets the formula for the annotation text.
00604   Parameters:
00605     text_value - [in]
00606   Returns:
00607     Value of the annotation text.
00608   See Also:
00609     ON_Annotation2Text::SetTextValue()
00610     ON_Annotation2Text::Value()    
00611     ON_Annotation2Text::Formula()    
00612   Remarks:
00613     Annotation text values can be constant or the result 
00614     of evaluating text formula containing %<...>% 
00615     expressions. The ...TextValue() functions set
00616     and get the text's value.  The ...TextFormula()
00617     functions get and set the text's formula.
00618   */
00619   void SetTextFormula( const wchar_t* s );
00620 
00621   /*
00622     Description:
00623       Set or get a flag indication that the dimension text has been moved
00624       from the default location.
00625     Parameters:
00626       bUserPositionedText - [in] 
00627                true to indicate that the text has been placed by the user.
00628                false to indicate that it hasn't
00629     Returns:
00630       @untitled table
00631       true    The text has been moved
00632       false   The text is in the default location
00633     Remarks:
00634       If the text is in the default location, it should be repositioned
00635       automatically when the dimension is adjusted.
00636       If it has been moved, it should not be automatically positioned.
00637   */
00638   void SetUserPositionedText( int bUserPositionedText );
00639   bool UserPositionedText() const;
00640 
00641   /*
00642     Description:
00643       Set or get the text display mode for the annotation
00644     Parameters:
00645       [in] ON::eTextDisplayMode mode - new mode to set
00646     Returns:
00647       ON::eTextDisplayMode  - current mode
00648     Remarks:
00649       This is the way the text is oriented with respect to the dimension line or screen:
00650       Above line, In LIne, Horizontal
00651   */
00652   void SetTextDisplayMode( ON::eTextDisplayMode);
00653   ON::eTextDisplayMode TextDisplayMode() const;
00654 
00655 
00656   /*
00657     Description:
00658       Gets a transform matrix to change from the object's 2d ECS to 3d WCS
00659     Parameters:
00660       [out] xform   set to produce the ECS to WCS transform
00661     Returns:
00662       @untitled table
00663       true    Success
00664       false   Failure
00665   */
00666   ON_BOOL32 GetECStoWCSXform( ON_Xform&) const;
00667 
00668   /*
00669     Description:
00670       Gets a transform matrix to change from to 3d WCS to the object's 2d ECS
00671     Parameters:
00672       [out] xform - set to produce the WCS to ECS transform
00673     Returns:
00674       @untitled table
00675       true    Success
00676       false   Failure
00677   */
00678   ON_BOOL32 GetWCStoECSXform( ON_Xform& xform) const;
00679 
00680   /*
00681     Description:
00682       Set the object's point array to a specified length
00683     Parameters:
00684       [in] length - the new size of the array
00685     Returns:
00686       void
00687   */
00688   void ReservePoints( int);
00689 
00690 
00691   /*
00692     Description:
00693       static function to provide the default UserText string for the object
00694     Returns:
00695       const wchar_t* - the default string to use
00696   */
00697   static const wchar_t* DefaultText();
00698 
00699   /*
00700     Description:
00701       Convert back to the version of ON_Annotation used in Rhino 2
00702     Parameters:
00703       target [out] the old-style object
00704     Returns:
00705       @untitled table
00706       true     Success
00707       False    Failure
00708     See Also:  ON_AngularDimension::ConvertBack()
00709   */
00710   virtual 
00711   void ConvertBack( ON_Annotation& target);
00712 
00713   /*
00714     Description:
00715       Set or Get the text justification
00716     Parameters:
00717       justification [in] See enum eJustification for meanings
00718     Returns:
00719       The justification for the text in this object
00720     Comments:
00721       This is not implemented on all annotation objects.
00722       The default SetJustification() does nothing
00723       The default Justification() always returns 0
00724 
00725   */
00726   virtual
00727   void SetJustification( unsigned int justification);
00728 
00729   virtual 
00730   unsigned int Justification();
00731 
00732   /*
00733     Description:
00734       Get the transformation that maps the annotation's
00735       text to world coordinates.
00736       Added Oct 30, 07 LW
00737     Parameters:
00738       gdi_text_rect - [in] 
00739               Windows gdi rect of text when it is drawn with
00740               LOGFONT lfHeight = ON_Font::normal_font_height.
00741       gdi_height_of_I - [in]
00742          Value returned by ON_Font::HeightOfI().
00743       dimstyle_textheight - [in]
00744          Height of text in world units.  If the annotation is
00745          an ON_TextEntity2, this is the m_textheight value.  
00746          If the annotation is not an ON_TextEntity2, pass in 
00747          the value returned by the dimension style's 
00748          ON_DimStyle::TextHeight() 
00749       dimstyle_textgap - [in]
00750          The value of the annotation's dimension style's 
00751          ON_DimStyle::TextGap().
00752       dimstyle_textalignment - [in]
00753          ON::TextDisplayMode(ON_DimStyle::TextAlignment()).
00754       dimscale - [in]
00755          Global dimension scaling value.  If you are using the
00756          Rhino SDK, this value is returned by
00757          CRhinoDoc::Properties().AnnotationSettings().DimScale().
00758          If you are using the OpenNURBS IO toolkit, this value
00759          is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
00760       cameraX - [in]
00761          zero or the view's unit camera right vector
00762       cameraY - [in]
00763          zero or the view's unit camera up vector
00764       model_xform - [in] transforms the text's parent entity 
00765          to world coordinates in case its instance geometry
00766          NULL == Identity
00767       text_xform - [out]
00768     Returns:
00769       True if text_xform is set.
00770   */
00771   bool GetTextXform( 
00772         ON_RECT gdi_text_rect,
00773         int gdi_height_of_I,
00774         double dimstyle_textheight,
00775         double dimstyle_textgap,
00776         ON::eTextDisplayMode dimstyle_textalignment,
00777         double dimscale,
00778         ON_3dVector cameraX,
00779         ON_3dVector cameraY,
00780         const ON_Xform* model_xform,
00781         ON_Xform& text_xform // output
00782         ) const;
00783 
00784   /*
00785     Description:
00786 
00787     This function has been replaced with a version that
00788     takes a model transform to transform block instance 
00789     geometry to world coordinates  Oct 30, 07 LW
00790 
00791       Get the transformation that maps the annotation's
00792       text to world coordinates.
00793     Parameters:
00794       gdi_text_rect - [in] 
00795               Windows gdi rect of text when it is drawn with
00796               LOGFONT lfHeight = ON_Font::normal_font_height.
00797       gdi_height_of_I - [in]
00798          Value returned by ON_Font::HeightOfI().
00799       dimstyle_textheight - [in]
00800          Height of text in world units.  If the annotation is
00801          an ON_TextEntity2, this is the m_textheight value.  
00802          If the annotation is not an ON_TextEntity2, pass in 
00803          the value returned by the dimension style's 
00804          ON_DimStyle::TextHeight() 
00805       dimstyle_textgap - [in]
00806          The value of the annotation's dimension style's 
00807          ON_DimStyle::TextGap().
00808       dimstyle_textalignment - [in]
00809          ON::TextDisplayMode(ON_DimStyle::TextAlignment()).
00810       dimscale - [in]
00811          Global dimension scaling value.  If you are using the
00812          Rhino SDK, this value is returned by
00813          CRhinoDoc::Properties().AnnotationSettings().DimScale().
00814          If you are using the OpenNURBS IO toolkit, this value
00815          is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
00816       cameraX - [in]
00817          zero or the view's unit camera right vector
00818       cameraY - [in]
00819          zero or the view's unit camera up vector
00820       xform - [out]
00821     Returns:
00822       True if xform is set.
00823   */
00824   bool GetTextXform( 
00825         ON_RECT gdi_text_rect,
00826         int gdi_height_of_I,
00827         double dimstyle_textheight,
00828         double dimstyle_textgap,
00829         ON::eTextDisplayMode dimstyle_textalignment,
00830         double dimscale,
00831         ON_3dVector cameraX,
00832         ON_3dVector cameraY,
00833         ON_Xform& xform
00834         ) const;
00835 
00836   /*
00837     Description:
00838       Get the transformation that maps the annotation's
00839       text to world coordinates.
00840       Oct 30, 07 LW
00841     Parameters:
00842       gdi_text_rect - [in] 
00843               Windows gdi rect of text when it is drawn with
00844               LOGFONT lfHeight = ON_Font::normal_font_height.
00845       font - [in]
00846       dimstyle - [in]
00847       dimscale - [in]
00848          Global dimension scaling value.  If you are using the
00849          Rhino SDK, this value is returned by
00850          CRhinoDoc::Properties().AnnotationSettings().DimScale().
00851          If you are using the OpenNURBS IO toolkit, this value
00852          is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
00853       vp - [in]
00854       model_xform - [in] transforms the text's parent entity 
00855          to world coordinates in case its instance geometry
00856          NULL == Identity
00857       text_xform - [out]
00858     Returns:
00859       True if text_xform is set.
00860   */
00861   //bool GetTextXform( 
00862   //    const ON_RECT gdi_text_rect,
00863   //    const ON_Font& font,
00864   //    const ON_DimStyle& dimstyle,
00865   //    double dimscale,
00866   //    const ON_Viewport* vp,
00867   //    const ON_Xform* model_xform,
00868   //    ON_Xform& text_xform  // output
00869   //    ) const;
00870   bool GetTextXform( 
00871       const ON_RECT gdi_text_rect,
00872       const ON_Font& font,
00873       const ON_DimStyle* dimstyle,
00874       double dimscale,
00875       const ON_Viewport* vp,
00876       const ON_Xform* model_xform,
00877       ON_Xform& text_xform  // output
00878       ) const;
00879 
00880   /*
00881     Description:
00882 
00883     This function has been replaced with a version that
00884     takes a model transform because the viewport doesn't 
00885     contain block instance transform info  Oct 30, 07 LW
00886 
00887       Get the transformation that maps the annotation's
00888       text to world coordinates.
00889     Parameters:
00890       gdi_text_rect - [in] 
00891               Windows gdi rect of text when it is drawn with
00892               LOGFONT lfHeight = ON_Font::normal_font_height.
00893       font - [in]
00894       dimstyle - [in]
00895       dimscale - [in]
00896          Global dimension scaling value.  If you are using the
00897          Rhino SDK, this value is returned by
00898          CRhinoDoc::Properties().AnnotationSettings().DimScale().
00899          If you are using the OpenNURBS IO toolkit, this value
00900          is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
00901       vp - [in]
00902       xform - [out]
00903     Returns:
00904       True if xform is set.
00905   */
00906   bool GetTextXform( 
00907       ON_RECT gdi_text_rect,
00908       const ON_Font& font,
00909       const ON_DimStyle& dimstyle,
00910       double dimscale,
00911       const ON_Viewport* vp,
00912       ON_Xform& xform
00913       ) const;
00914 
00915   /*
00916   Description:
00917     Get the annotation plane coordinates (ECS) of the point
00918     that is used to position the text.  The relative position
00919     of the text to this points depends on the type of
00920     annotation, the dimstyle's text alignment flag, and the
00921     view projection.
00922     This point is not  the same as the base point of the text.
00923   Parameters:
00924     text_point - [out];
00925   Returns:
00926     True if text_point is set.
00927   */
00928   bool GetTextPoint( ON_2dPoint& text_2d_point ) const;
00929 
00930   // enum for tyoe of annotation DimLinear, DimRadius, etc.
00931   ON::eAnnotationType m_type;
00932 
00933   // m_textdisplaymode controls the orientation
00934   // of the text.
00935   // If m_textdisplaymode = dtHorizontal, then
00936   // the text is always horizontal and in the
00937   // view plane.  Otherwise it lies in m_plane.
00938   ON::eTextDisplayMode m_textdisplaymode;
00939 
00940   // m_plane is the plane containing the annotation.
00941   // All parts of the annotation that are not
00942   // text lie in this plane. If
00943   // m_textdisplaymode != dtHorizontal, then
00944   // the text lies in the plane too.  
00945   // (ECS reference plane in WCS coordinates.)
00946   ON_Plane m_plane;
00947 
00948   // Definition points for the dimension.
00949   // These are 2d coordinates in m_plane.
00950   // The location of these points depends on the
00951   // type of annotation class.  There is a comment
00952   // at the start of the definions for
00953   // ON_LinearDimension2, ON_RadialDimension2,
00954   // ON_AngularDimension2, ON_TextEntity2, and
00955   // ON_Leader2 that explains how the points are used.
00956   ON_2dPointArray m_points;
00957 
00958   // With the addition of tolerances and therefore multi-line
00959   // text, the ON_wString in m_usertext will hold multiple 
00960   // strings with NULLs between them.  
00961   // The strings will be in this order:
00962   // Result of expanding "<>", or user override
00963   // Alternate dimension
00964   // Tolerance upper
00965   // Tolerance lower
00966   // Alt tolerance upper
00967   // Alt tolerance lower
00968   // Prefix
00969   // Suffix
00970   // Alt prefix
00971   // Alt suffix
00972   // 
00973   ON_Annotation2Text m_usertext;
00974 
00975   // true: User has positioned text
00976   // false: use default location
00977   bool m_userpositionedtext;
00978   // Added 13 Aug, 2010 - Lowell
00979   // This determines whether the object will be scaled according to detail
00980   // scale factor or by 1.0 in paperspace rather than by 
00981   // dimscale or text scale.
00982   // For the first try this will only be used on text and its
00983   // here on the base class because it would fit and in case 
00984   // its needed later on dimensions.
00985   bool m_annotative_scale;
00986 private:
00987   bool m_reserved_b1;
00988   bool m_reserved_b2;
00989 public:
00990 
00991   // For dimensions, this is the ON_DimStyle index
00992   // For text, its the ON_Font index
00993   int m_index;
00994 
00995   // Text height in model units
00996   // This is used by text, but not by dimensions
00997   // Dimensions get their height from dimension styles
00998   double m_textheight;
00999 
01000   // Left, Center, Right / Bottom, Middle, Top text justification
01001   // See eTextJustification above
01002   unsigned int m_justification;
01003 };
01004 
01005 
01006 // Subclass of ON_Annotation2 to provide linear dimensions
01007 class ON_CLASS ON_LinearDimension2 : public ON_Annotation2
01008 {
01009   ON_OBJECT_DECLARE(ON_LinearDimension2);
01010 
01011 public:
01012 
01013   /*
01014     The annotation's dimstyle controls the position of TEXT,
01015     the size of the arrowheads, and the amount the ends of 
01016     linear dimension's extension lines extend beyond the 
01017     dimension lines.
01018 
01019     In the picture below, [n] means ON_Annotation2::m_points[n].
01020 
01021                                                      [2]
01022                                                       |
01023         |                                             |
01024        [1]-------------------------------------------[3]
01025         |                                             |
01026         |                       TEXT
01027         |                       [4]
01028        [0]
01029 
01030       The "x" and "y" coordinates of [0] must be (0.0, 0.0).
01031 
01032       The "x" coordinate of [1] = "x" of [0]
01033       The "y" coordinate of [1] can be any value.
01034 
01035       The "x" and "y" coordinates of [2] can be any value.
01036 
01037       The "x" coordinate of [3] = "x" coordinate of [2].
01038       The "y" coordinate of [3] = "y" coordinate of [1].
01039   */
01040 
01041   enum POINT_INDEX
01042   {
01043     // Do not change these enum values.  They are saved in files as the 
01044     // ON_COMPONENT_INDEX.m_index value.
01045     //
01046     // Indices of linear dimension definition points in 
01047     // the m_points[] array
01048     ext0_pt_index    = 0, // end of first extension line
01049     arrow0_pt_index  = 1, // arrowhead tip on first extension line
01050     ext1_pt_index    = 2, // end of second extension line
01051     arrow1_pt_index  = 3, // arrowhead tip on second extension line
01052     userpositionedtext_pt_index = 4,
01053     dim_pt_count     = 5, // number of m_points[] in an angular dim
01054 
01055     // Points calculated from values in m_points[]
01056     text_pivot_pt = 10000, // center of dimension text
01057     dim_mid_pt    = 10001  // midpoint of dimension line
01058   };
01059 
01060   ON_LinearDimension2();
01061   ~ON_LinearDimension2();
01062   // C++ automatically provides the correct copy constructor and operator= .
01063   //ON_LinearDimension2( const ON_LinearDimension2& );
01064   //ON_LinearDimension2& operator=(const ON_LinearDimension2&);
01065 
01066   // overrides virtual ON_Geometry::Transform()
01067   ON_BOOL32 Transform( const ON_Xform& xform );
01068 
01069   /*
01070   Description:
01071     Checks the linear dimension and repairs any point locations or flags
01072     that are not set correctly.
01073   Returns:
01074     0:  linear dimension is damaged beyond repair
01075     1:  linear dimension was perfect and nothing needed to be repaired.
01076     2:  linear dimension had flaws that were repaired.
01077   */
01078   int Repair();
01079 
01080   /*
01081   Description:
01082     Get the m_plane coordinates of the dimension point.
01083   Parameters:
01084     point_index - [in] One of the POINT_INDEX enum values
01085   Returns:
01086     2d point or ON_UNSET_POINT if point_index or m_points[]
01087     array is not valid.
01088   */
01089   ON_2dPoint Dim2dPoint(
01090        int point_index
01091        ) const;
01092 
01093   /*
01094   Description:
01095     Get the m_plane coordinates of the dimension point.
01096   Parameters:
01097     point_index - [in] One of the POINT_INDEX enum values
01098   Returns:
01099     2d point or ON_UNSET_POINT if point_index or m_points[]
01100     array is not valid.
01101   */
01102   ON_3dPoint Dim3dPoint(
01103        int point_index
01104        ) const;
01105 
01106   // overrides virual ON_Object::IsValid
01107   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
01108 
01109   // overrides virual ON_Object::Write
01110   ON_BOOL32 Write(ON_BinaryArchive&) const;
01111 
01112   // overrides virual ON_Object::Read
01113   ON_BOOL32 Read(ON_BinaryArchive&);
01114 
01115   // overrides virual ON_Geometry::GetBBox
01116   ON_BOOL32 GetBBox(
01117          double*,
01118          double*,
01119          ON_BOOL32 = false
01120          ) const;
01121 
01122   // overrides virual ON_Geometry::GetTightBoundingBox
01123         bool GetTightBoundingBox( 
01124                         ON_BoundingBox& tight_bbox, 
01125       int bGrowBox = false,
01126                         const ON_Xform* xform = 0
01127       ) const;
01128 
01129   /*
01130   Description:
01131     Overrides virtual ON_Annotation2::NumericValue();
01132   Returns:
01133     distance between arrow tips
01134   */
01135   double NumericValue() const;
01136 
01137   /*
01138     Description:
01139       Get or set the DimStyle index in the dimstyle table for the dimension
01140     Parameters:
01141       [in] int  the new index (Set)
01142     Returns:
01143       int -  The current index (Get)
01144   */
01145   int StyleIndex() const;
01146   void SetStyleIndex( int);
01147 
01148   /*
01149     Description:
01150       static function to provide the default UserText string for the object
01151     Returns:
01152       const wchar_t* - the default string to use
01153   */
01154   static const wchar_t* DefaultText();
01155 
01156 
01157 // 6-23-03 lw Added v2 file writing of annotation
01158   void GetV2Form( ON_LinearDimension& dim);
01159 
01160   bool CreateFromV2( 
01161       const ON_Annotation& v2_ann,
01162       const ON_3dmAnnotationSettings& settings,
01163       int dimstyle_index
01164       );
01165 
01166   /*
01167   Description:
01168     Get the annotation plane x coordinates of the dimension
01169     line. The y coordinate of the dimension line is m_ponts[1].y.
01170   Parameters:
01171     gdi_text_rect - [in] 
01172        Windows rect (left < right, top < bottom) that bounds text.
01173        The baseline of the text should be at y=0 in the rect coordinates.
01174     gdi_height_of_I - [in] 
01175        Height of an I in the text in the same.
01176     gdi_to_world - [in] 
01177        transform returned by ON_Annotation2::GetTextXform().
01178     dimstyle - [in]
01179       dimscale - [in]
01180     vp - [in]
01181     x - [out] plane x coordinates of the dimension line.
01182               The y coordinate = m_points[arrow0_pt_index].y
01183     bInside - [out] true if arrowheads go inside extension lines, 
01184                     false if they go outside
01185   Returns:
01186     0: the input or class is not valid
01187     1: A single line from x[0] to x[1] with arrow heads at both ends.
01188         Arrowtips at x[4] & x[5]
01189     2: Two lines from x[0] to x[1] and from x[1] to x[2].  The
01190         Arrowtips at x[4] & x[5]
01191        
01192   */
01193   int GetDimensionLineSegments(
01194       ON_RECT gdi_text_rect,
01195       int gdi_height_of_I,
01196       ON_Xform gdi_to_world,
01197       const ON_DimStyle& dimstyle,
01198       double dimscale,
01199       const ON_Viewport* vp,
01200       double a[6],
01201       bool& bInside
01202       ) const;
01203 
01204 
01205   // Added for V5. 4/24/07 LW
01206   // Get the userdata extension for this dimension
01207   ON_DimensionExtra* DimensionExtension();
01208   const ON_DimensionExtra* DimensionExtension() const;
01209 
01210 
01211 
01212 
01213 };
01214 
01216 // class ON_RadialDimension2
01217 class ON_CLASS ON_RadialDimension2 : public ON_Annotation2
01218 {
01219   ON_OBJECT_DECLARE(ON_RadialDimension2);
01220 
01221 public:
01222 
01223   /*
01224     The annotation's dimstyle controls the position of TEXT,
01225     and the size of the arrowheads.
01226 
01227     In the picture below, [n] means ON_Annotation2::m_points[n].
01228 
01229     Radial dimensions do not permit user positioned text
01230 
01231 
01232            knee
01233             [3]--------[2] TEXT
01234             /         (tail)
01235            /
01236           /
01237         [1] (arrow head here)
01238 
01239 
01240     + [0] = (usually at (0,0) = center of circle)
01241   */
01242 
01243   enum POINT_INDEX
01244   {
01245     // Do not change these enum values.  They are saved in files as the 
01246     // ON_COMPONENT_INDEX.m_index value.
01247     //
01248     // Indices of radial dimension definition points in 
01249     // the m_points[] array
01250     center_pt_index = 0, // location of + (usually at center of circle)
01251     arrow_pt_index  = 1, // arrow tip
01252     tail_pt_index   = 2, // end of radial dimension
01253     knee_pt_index   = 3, // number of m_points[] in a radial dim
01254     dim_pt_count    = 4, // number of m_points[] in a radial dim
01255 
01256     // Points calculated from values in m_points[]
01257     text_pivot_pt = 10000, // start/end of dimension text at tail
01258   };
01259 
01260   ON_RadialDimension2();
01261   ~ON_RadialDimension2();
01262   // C++ automatically provides the correct copy constructor and operator= .
01263   //ON_RadialDimension2(const ON_RadialDimension2&);
01264   //ON_RadialDimension2& operator=(const ON_RadialDimension2&);
01265 
01266   // overrides virtual ON_Geometry::Transform()
01267   ON_BOOL32 Transform( const ON_Xform& xform );
01268 
01269   /*
01270   Description:
01271     Get the m_plane coordinates of the dimension point.
01272   Parameters:
01273     point_index - [in] One of the POINT_INDEX enum values
01274   Returns:
01275     2d point or ON_UNSET_POINT if point_index or m_points[]
01276     array is not valid.
01277   */
01278   ON_2dPoint Dim2dPoint(
01279        int point_index
01280        ) const;
01281 
01282   /*
01283   Description:
01284     Get the m_plane coordinates of the dimension point.
01285   Parameters:
01286     point_index - [in] One of the POINT_INDEX enum values
01287   Returns:
01288     2d point or ON_UNSET_POINT if point_index or m_points[]
01289     array is not valid.
01290   */
01291   ON_3dPoint Dim3dPoint(
01292        int point_index
01293        ) const;
01294 
01295 
01296   // overrides virual ON_Object::IsValid
01297   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
01298 
01299   // overrides virual ON_Object::Write
01300   ON_BOOL32 Write(ON_BinaryArchive&) const;
01301 
01302   // overrides virual ON_Object::Read
01303   ON_BOOL32 Read(ON_BinaryArchive&);
01304 
01305   // overrides virual ON_Geometry::GetBBox
01306   ON_BOOL32 GetBBox(
01307          double*,
01308          double*,
01309          ON_BOOL32 = false
01310          ) const;
01311 
01312   // overrides virual ON_Geometry::GetTightBoundingBox
01313         bool GetTightBoundingBox( 
01314                         ON_BoundingBox& tight_bbox, 
01315       int bGrowBox = false,
01316                         const ON_Xform* xform = 0
01317       ) const;
01318 
01319   /*
01320     Description:
01321       Set the plane and definition points from WCS 3d input
01322     Parameters:
01323       center - [in] center of circle
01324       arrowtip - [in] 3d point on the circle at the dimension arrow tip
01325       xaxis - [in] x axis of the dimension's plane
01326       normal - [in] normal to the dimension's plane
01327       offset_distance - [in] distance from arrow tip to knee point
01328     Returns:
01329       @untitled table
01330       true     Success
01331       false    Failure
01332   */
01333   bool CreateFromPoints( 
01334           ON_3dPoint center, 
01335           ON_3dPoint arrowtip, 
01336           ON_3dVector xaxis, 
01337           ON_3dVector normal,
01338           double offset_distance
01339           );
01340 
01341   /*
01342   Description:
01343     Overrides virtual ON_Annotation2::NumericValue();
01344   Returns:
01345     If m_type is ON::dtDimDiameter, then the diameter
01346     is returned, othewise the radius is returned.
01347   */
01348   double NumericValue() const;
01349 
01350   /*
01351     Description:
01352       Get or set the DimStyle index in the dimstyle table for the dimension
01353     Parameters:
01354       [in] int  the new index (Set)
01355     Returns:
01356       int -  The current index (Get)
01357   */
01358   int StyleIndex() const;
01359   void SetStyleIndex( int);
01360 
01361   /*
01362     Description:
01363       static function to provide the default UserText string for the object
01364     Returns:
01365       const wchar_t* - the default string to use
01366   */
01367   static const wchar_t* DefaultDiameterText();
01368   static const wchar_t* DefaultRadiusText();
01369 
01370 // 6-23-03 lw Added v2 file writing of annotation
01371   void GetV2Form( ON_RadialDimension& dim);
01372 
01373   bool CreateFromV2( 
01374       const ON_Annotation& v2_ann,
01375       const ON_3dmAnnotationSettings& settings,
01376       int dimstyle_index
01377       );
01378 
01379   bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
01380   bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
01381 };
01382 
01383 
01385 // class ON_AngularDimension2
01386 class ON_CLASS ON_AngularDimension2 : public ON_Annotation2
01387 {
01388   ON_OBJECT_DECLARE(ON_AngularDimension2);
01389 
01390 public:
01391 
01392   /*
01393     The annotation's dimstyle controls the position of TEXT,
01394     the size of the arrowheads, and the amount the ends of 
01395     linear dimension's extension lines extend beyond the 
01396     dimension lines.
01397 
01398     In the picture below, [n] means ON_Annotation2::m_points[n].
01399 
01400     [0] = if m_userpositionedtext=true, this is the center of text.
01401           If m_userpositionedtext=false, this point is not used and
01402           the center of the text is at the arc's midpoint.
01403 
01404     Always counter clockwise arc in m_plane with center = (0,0)
01405     [1] = a point somewhere on the line from the center through the start point.
01406           The distance from center to [1] can be any value.
01407     [2] = a point somewhere on the line from the center through the end point.
01408           The distance from center to [2] can be any value.
01409     [3] = a point on the interior of the arc.  The distance 
01410           from (0,0) to [3] is the radius of the arc.
01411 
01412 
01413                   /
01414                 [2]
01415                 /
01416                /         [0]TEXT
01417               /
01418              /    [3]
01419      -----(0,0)----------[1]---
01420            /
01421           /
01422          /
01423 
01424   */
01425 
01426   enum POINT_INDEX
01427   {
01428     // Do not change these enum values.  They are saved in files as the 
01429     // ON_COMPONENT_INDEX.m_index value.
01430     //
01431     // Indices of angular dimension definition points in 
01432     // the m_points[] array
01433     userpositionedtext_pt_index  = 0, // 
01434     start_pt_index = 1, // point on the start ray (not necessarily on arc)
01435     end_pt_index   = 2, // point on the end ray (not necessarily on arc)
01436     arc_pt_index   = 3, // point on the interior of dimension arc
01437     dim_pt_count   = 4, // number of m_points[] in an angular dim
01438 
01439     // Points calculated from values in m_points[]
01440     text_pivot_pt = 10000, // center of dimension text
01441     arcstart_pt   = 10001,
01442     arcend_pt     = 10002,
01443     arcmid_pt     = 10003,
01444     arccenter_pt  = 10004, // center of circle arc lies on  
01445     extension0_pt = 10005, // point where first extension line starts
01446     extension1_pt = 10006  // point where second extension line starts
01447   };
01448 
01449   ON_AngularDimension2();
01450   ~ON_AngularDimension2();
01451   // C++ copy constructor and operator= work fine.
01452   //ON_AngularDimension2(const ON_AngularDimension2&);
01453   //ON_AngularDimension2& operator=(const ON_AngularDimension2&);
01454 
01455   // overrides virtual ON_Geometry::Transform()
01456   ON_BOOL32 Transform( const ON_Xform& xform );
01457 
01458   /*
01459   Description:
01460     Get the m_plane coordinates of the dimension point.
01461   Parameters:
01462     point_index - [in] One of the POINT_INDEX enum values
01463   Returns:
01464     2d point or ON_UNSET_POINT if point_index or m_points[]
01465     array is not valid.
01466   */
01467   ON_2dPoint Dim2dPoint(
01468        int point_index
01469        ) const;
01470 
01471   /*
01472   Description:
01473     Get the m_plane coordinates of the dimension point.
01474   Parameters:
01475     point_index - [in] One of the POINT_INDEX enum values
01476   Returns:
01477     2d point or ON_UNSET_POINT if point_index or m_points[]
01478     array is not valid.
01479   */
01480   ON_3dPoint Dim3dPoint(
01481        int point_index
01482        ) const;
01483 
01484 
01485   // overrides virual ON_Object::IsValid
01486   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
01487 
01488   // overrides virual ON_Geometry::GetBBox
01489   ON_BOOL32 GetBBox(
01490          double*,
01491          double*,
01492          ON_BOOL32 = false
01493          ) const;
01494 
01495   // overrides virual ON_Geometry::GetTightBoundingBox
01496         bool GetTightBoundingBox( 
01497                         ON_BoundingBox& tight_bbox, 
01498       int bGrowBox = false,
01499                         const ON_Xform* xform = 0
01500       ) const;
01501 
01502   /*
01503     Description:
01504       Read from or write to a file
01505     Returns:
01506       @untitled Table
01507       true     Success
01508       false    Failure
01509   */
01510   ON_BOOL32 Write( ON_BinaryArchive& file ) const;
01511   ON_BOOL32 Read( ON_BinaryArchive& file );
01512 
01513   /*
01514     Description:
01515       Set the plane and definition points from 3d points
01516       in world coordinates.
01517     Parameters:
01518       apex - [in] 3d apex of the dimension
01519                   (center of arc)
01520       p0 - [in] 3d point on first line
01521       p1 - [in] 3d point on second line
01522       arcpt - [in] 3d point on dimension arc 
01523                    (determines radius of arc)
01524       Normal - [in] normal of the plane on which to make the dimension
01525                     (must be perpendicular to p0-apex and p1-apex) 
01526     Returns:
01527       @untitled table
01528       true     Success
01529       false    Failure
01530   */
01531   bool CreateFromPoints( 
01532     const ON_3dPoint& apex, 
01533     const ON_3dPoint& p0, 
01534     const ON_3dPoint& p1, 
01535     ON_3dPoint& arcpt, 
01536     ON_3dVector& Normal
01537     );
01538 
01539   /*
01540     Description:
01541       Set the plane and definition points from a 3d arc.
01542     Parameters:
01543       arc - [in]
01544     Returns:
01545       @untitled table
01546       true     Success
01547       false    Failure
01548   */
01549   bool CreateFromArc( 
01550     const ON_Arc& arc
01551     );
01552 
01553   bool CreateFromV2( 
01554       const ON_Annotation& v2_ann,
01555       const ON_3dmAnnotationSettings& settings,
01556       int dimstyle_index
01557       );
01558 
01559   bool GetArc( ON_Arc& arc ) const;
01560 
01561   bool GetExtensionLines(ON_Line extensions[2]) const;
01562 
01563   // Set or get the measured angle in radians
01564   void SetAngle( double angle);
01565   double Angle() const;
01566   void SetRadius( double radius);
01567   double Radius() const;
01568 
01569   /*
01570   Description:
01571     Overrides virtual ON_Annotation2::NumericValue();
01572   Returns:
01573     Angle in degrees
01574   */
01575   double NumericValue() const;
01576 
01577   /*
01578     Description:
01579       Get or set the DimStyle index in the dimstyle table for the dimension
01580     Parameters:
01581       [in] int  the new index (Set)
01582     Returns:
01583       int -  The current index (Get)
01584   */
01585   int StyleIndex() const;
01586   void SetStyleIndex( int);
01587 
01588   /*
01589     Description:
01590       static function to provide the default UserText string for the object
01591     Returns:
01592       const wchar_t* - the default string to use
01593   */
01594   static const wchar_t* DefaultText();
01595 
01596 
01597   /*
01598     Description:
01599       Convert back to the version of ON_Annotation used in Rhino 2
01600     Parameters:
01601       target [out] the old-style object
01602     Returns:
01603       @untitled table
01604       true     Success
01605       False    Failure
01606     See Also:  ON_AnnotationObject::ConvertBack()
01607   */
01608   void ConvertBack( ON_AngularDimension2& target);
01609 
01610 // 6-23-03 lw Added v2 file writing of annotation
01611   void GetV2Form( ON_AngularDimension& dim);
01612 
01613   double m_angle;      // angle being dimensioned
01614   double m_radius;     // radius for dimension arc
01615 
01616   /*
01617   Description:
01618     Get the annotation plane angles of the dimension arc.
01619   Parameters:
01620     gdi_text_rect - [in] Windows rect (left < right, top < bottom)
01621        that bounds text.
01622     gdi_height_of_I - [in] 
01623        Height of an I in the text.
01624     gdi_to_world - [in] 
01625        transform returned by ON_Annotation2::GetTextXform().
01626     dimstyle - [in]
01627       dimscale - [in]
01628     vp - [in]
01629     a - [out]
01630       angles at the ends of the arc segment(s) and the arrow tips
01631     bInside - [out] true if arrowheads go inside, false if they go outside
01632   Returns:
01633     number of arc segments to draw
01634     0: the input or class is not valid
01635     1: A single arc from a[0] to a[1] with arrow heads at a[4] & a[5].
01636     2: Two arcs from a[0] to a[1] & from a[2] to a[3].
01637        Arrowheads are at a[4] & a[5].
01638   */
01639   int GetDimensionArcSegments(
01640       ON_RECT gdi_text_rect,
01641       int gdi_height_of_I,
01642       ON_Xform gdi_to_world,
01643       const ON_DimStyle& dimstyle,
01644       double dimscale,
01645       const ON_Viewport* vp,
01646       double a[6],
01647       bool& bInside
01648       ) const;
01649 
01650   
01651   /*
01652   Description:
01653     Get distance from dimension apex to extension line offset points
01654   Parameters:
01655     index - [in]  which distance to get
01656   Returns:
01657     Distance to offset point [index]
01658   */
01659   double DimpointOffset(
01660     int index) const;
01661 
01662   /*
01663   Description:
01664     Set distance from dimension apex to extension line offset points
01665   Parameters:
01666     index  - [in]  which distance to set
01667     offset - [in] Value to set
01668   */
01669   void SetDimpointOffset(
01670     int index, 
01671     double offset);
01672 };
01673 
01674 
01675 
01676 /*
01677   class ON_LinearDimension2
01678 
01679   Description:
01680     Override od ON_Annotation2 to provide linear dimensions
01681 */
01682 class ON_CLASS ON_OrdinateDimension2 : public ON_Annotation2
01683 {
01684   ON_OBJECT_DECLARE(ON_OrdinateDimension2);
01685 
01686 public:
01687 
01688   /*
01689     In the picture below, [n] means ON_Annotation2::m_points[n].
01690 
01691     Measures in X direction
01692 
01693                        [1]
01694                         |
01695                         |
01696                         |
01697                         |
01698                         |
01699                        [0]
01700        +
01701  [plane origin]                                      [plane origin]
01702                                                            +
01703 
01704       or - Measures in Y direction                                                   *---[1]       
01705                                                                                     /
01706                                                                                    /
01707                    [0]--------------------[1]                   [0]---------------*
01708 
01709 
01710                                                                               * = calculated, not stored
01711 
01712 
01713        +     
01714  [plane origin]
01715 
01716 
01717       The reference point of for the dimension is at the entity plane origin
01718       The "x" and "y" coordinates of [1] can be any value.
01719       The "x" and "y" coordinates of [2] can be any value.
01720       If Direction is "x", the dimension measures along the "x" axis
01721       If Direction is "y", the dimension measures along the "y" axis
01722       If Direction is "x" and [1][x] <> [0][x], an offset segment is drawn
01723       If Direction is "y" and [1][y] <> [0][y], an offset segment is drawn
01724       The dimension lines are always drawn in the X or Y directions of the entity plane
01725       The distance represented by the dimension is measured from the 
01726         plane origin to point [0], parallel to the appropriate axis.
01727       The points of the offset segment are calculated rather than stored
01728   */
01729 
01730   enum POINT_INDEX
01731   {
01732     // Do not change these enum values.  They are saved in files as the 
01733     // ON_COMPONENT_INDEX.m_index value.
01734     //
01735     // Indices of linear dimension definition points in 
01736     // the m_points[] array
01737     definition_pt_index    = 0, // First end of the dimension line
01738     leader_end_pt_index    = 1, // Other end of the leader (near the text)
01739     dim_pt_count           = 2, // Number of m_points[] in an ordinate dim
01740 
01741     // Points calculated from values in m_points[]
01742     text_pivot_pt = 10000, // Center of dimension text
01743     offset_pt_0   = 10001, // First offset point  (nearest text)
01744     offset_pt_1   = 10002  // Second offset point
01745   };
01746 
01747   enum DIRECTION
01748   {
01749     x = 0,  // measures horizontally
01750     y = 1,  // measures vertically
01751   };
01752 
01753   ON_OrdinateDimension2();
01754   ~ON_OrdinateDimension2();
01755 
01756   // overrides virtual ON_Geometry::Transform()
01757   ON_BOOL32 Transform( const ON_Xform& xform );
01758 
01759   /*
01760   Description:
01761     Get the m_plane coordinates of the dimension point.
01762   Parameters:
01763     point_index - [in] One of the POINT_INDEX enum values
01764     default_offset [in] - kink offset to use if m_kink_offset_0
01765                           or m_kink_offset_1 are ON_UNSET_VALUE
01766   Returns:
01767     2d point or ON_UNSET_POINT if point_index or m_points[]
01768     array is not valid.
01769   */
01770   ON_2dPoint Dim2dPoint(
01771        int point_index,
01772        double default_offset = 1.0
01773        ) const;
01774 
01775   /*
01776   Description:
01777     Get the m_plane coordinates of the dimension point.
01778   Parameters:
01779     point_index - [in] One of the POINT_INDEX enum values
01780     default_offset [in] - kink offset to use if m_kink_offset_0
01781                           or m_kink_offset_1 are ON_UNSET_VALUE
01782   Returns:
01783     2d point or ON_UNSET_POINT if point_index or m_points[]
01784     array is not valid.
01785   */
01786   ON_3dPoint Dim3dPoint(
01787        int point_index,
01788        double default_offset = 1.0
01789        ) const;
01790 
01791   // overrides virual ON_Object::IsValid
01792   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
01793 
01794   // overrides virual ON_Geometry::GetBBox
01795   ON_BOOL32 GetBBox(
01796          double* boxmin,
01797          double* boxmax,
01798          ON_BOOL32 bGrowBox = false
01799          ) const;
01800 
01801   // overrides virual ON_Geometry::GetTightBoundingBox
01802         bool GetTightBoundingBox( 
01803                         ON_BoundingBox& tight_bbox, 
01804       int bGrowBox = false,
01805                         const ON_Xform* xform = 0
01806       ) const;
01807 
01808   /*
01809     Description:
01810       Read from or write to a file
01811     Returns:
01812       @untitled Table
01813       true     Success
01814       false    Failure
01815   */
01816   ON_BOOL32 Write( ON_BinaryArchive& file ) const;
01817   ON_BOOL32 Read( ON_BinaryArchive& file );
01818 
01819   /*
01820   Description:
01821     Overrides virtual ON_Annotation2::NumericValue();
01822   Returns:
01823     If Direction is 'X', x coordinate of point[1]
01824     If Direction is 'Y', y coordinate of point[1]
01825   */
01826   double NumericValue() const;
01827 
01828   /*
01829     Description:
01830       Get or set the DimStyle index in the dimstyle table for the dimension
01831     Parameters:
01832       [in] int  the new index (Set)
01833     Returns:
01834       int -  The current index (Get)
01835   */
01836   int StyleIndex() const;
01837   void SetStyleIndex( int);
01838 
01839   /*
01840     Description:
01841       Gets the direction ( X or Y) that the ordinate dimension measures
01842       based on the relative location of the defining point and leader endpoint
01843     Returns:
01844       0: measures parallel to the entity plane x axis
01845       1: measures parallel to the entity plane y axis
01846     Remarks:
01847       This does not consider the dimension's explicit Direction setting 
01848   */
01849   int ImpliedDirection() const;
01850 
01851   /*
01852     Description:
01853       Gets or sets the direction ( X or Y) that the ordinate dimension measures
01854     Returns:
01855      -1: direction determined by dim point and leader point
01856       0: measures parallel to the entity plane x axis
01857       1: measures parallel to the entity plane y axis
01858   */
01859   int Direction() const;
01860   void SetDirection( int direction);
01861 
01862   /*
01863     Description:
01864       Get the height of the text in this dimension
01865       by asking the dimension's dimstyle
01866     Returns:
01867       double Height of the text
01868     Remarks:
01869       Height is in model units
01870   double Height() const;
01871   */
01872 
01873   /*
01874     Description:
01875       static function to provide the default UserText string for the object
01876     Returns:
01877       const wchar_t* - the default string to use
01878   */
01879   static const wchar_t* DefaultText();
01880 
01881   /*
01882     Description:
01883       Returns or sets the offset distance parallel to the dimension 
01884       line direction of from the text end of the dimension line to 
01885       the offset point 
01886       If the offset point hasn't been explicitly defined, returns 
01887       ON_UNSET_VALUE and a default should be used to find the point.
01888     Parameters:
01889       index [in] - which offset distance to return 
01890                    (0 is closer to the text)
01891       offset [in] - the offset distance to set
01892   */
01893   double KinkOffset( int index) const;
01894   void SetKinkOffset( int index, double offset);
01895 
01896 
01897   int m_direction;   // -1 == underermined
01898                      //  0 == x direction
01899                      //  1 == y direction
01900 
01901   // kink offsets added 2-4-06 - LW
01902   double m_kink_offset_0;  // from leader_end_point to first break point
01903   double m_kink_offset_1;  // from first break point to second break point
01904 
01905   /*
01906     Description:
01907       Calculates the 2d point locations of the dimension line kinks
01908 
01909     Parameters:
01910       p0, p1 [in] - End points of the dimension line
01911       direction [in] - orientation of the dimension
01912       default_offset [in] - Use this if offsets are ON_UNSET_VALUE
01913       k0, k1 [out] - The kink points
01914     Remarks:
01915       The offsets must be set to the right values before calling this, or
01916       If they are ON_UNSET_VALUE, they will be set to the defaults
01917   */
01918   void CalcKinkPoints( ON_2dPoint p0, ON_2dPoint p1, 
01919                        int direction, double default_offset,
01920                        ON_2dPoint& k0, ON_2dPoint& k1) const;
01921 
01922 };
01923 
01924 
01925 
01927 // class ON_TextEntity2
01928 class ON_CLASS ON_TextEntity2 : public ON_Annotation2
01929 {
01930   ON_OBJECT_DECLARE(ON_TextEntity2);
01931 
01932 public:
01933   ON_TextEntity2();
01934   ~ON_TextEntity2();
01935 
01936   // overrides virual ON_Object::IsValid
01937   // Text entities with strings that contain no "printable" characters
01938   // are considered to be NOT valid.
01939   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
01940 
01941   // overrides virual ON_Object::Write
01942   ON_BOOL32 Write(ON_BinaryArchive&) const;
01943 
01944   // overrides virual ON_Object::Read
01945   ON_BOOL32 Read(ON_BinaryArchive&);
01946 
01947   // overrides virtual ON_Geometry::Transform()
01948   ON_BOOL32 Transform( const ON_Xform& xform );
01949 
01950   // overrides virual ON_Geometry::GetBBox
01951   // This just adds the text base point to the box
01952   // There is no calculation of the size of the text or its bounds
01953   ON_BOOL32 GetBBox(
01954          double*,
01955          double*,
01956          ON_BOOL32 = false
01957          ) const;
01958 
01959   // overrides virual ON_Geometry::GetTightBoundingBox
01960   // This just adds the text base point to the box
01961   // There is no calculation of the size of the text or its bounds
01962         bool GetTightBoundingBox( 
01963                         ON_BoundingBox& tight_bbox, 
01964       int bGrowBox = false,
01965                         const ON_Xform* xform = 0
01966       ) const;
01967 
01968   /*
01969     Description:
01970       Get or set the Font index in the Font Table for the text
01971 
01972     Parameters:
01973       [in] int  the new index (Set)
01974 
01975     Returns:
01976       int -  The current index (Get)
01977   */
01978   int FontIndex() const;
01979   void SetFontIndex( int);
01980 
01981 // 6-23-03 lw Added v2 file writing of annotation
01982   void GetV2Form( ON_TextEntity& text);
01983 
01984   void SetJustification( unsigned int justification);
01985 
01986   unsigned int Justification();
01987 
01988   // Determines whether or not to draw a Text Mask
01989   bool DrawTextMask() const;
01990   void SetDrawTextMask(bool bDraw);
01991 
01992   // Determines where to get the color to draw a Text Mask
01993   // 0: Use background color of the viewport.  Initially, gradient backgrounds will not be supported
01994   // 1: Use the ON_Color returned by MaskColor()
01995   int MaskColorSource() const;
01996   void SetMaskColorSource(int source);
01997 
01998   ON_Color MaskColor() const;  // Only works right if MaskColorSource returns 1.
01999                                // Does not return viewport background color
02000   void SetMaskColor(ON_Color color);
02001 
02002   // Offset for the border around text to the rectangle used to draw the mask
02003   // This number * CRhinoAnnotation::TextHeight() for the text is the offset 
02004   // on each side of the tight rectangle around the text characters to the mask rectangle.
02005   double MaskOffsetFactor() const;
02006   void SetMaskOffsetFactor(double offset);
02007 
02008   // Scale annotation according to detail scale factor in paperspace
02009   // or by 1.0 in paperspace and not in a detail
02010   // Otherwise, dimscale or text scale is used
02011   bool AnnotativeScaling() const;
02012   void SetAnnotativeScaling(bool b);
02013 };
02014 
02016 // class ON_Leader2
02017 class ON_CLASS ON_Leader2 : public ON_Annotation2
02018 {
02019   ON_OBJECT_DECLARE(ON_Leader2);
02020 
02021 public:
02022 
02023   /*
02024     The annotation's dimstyle controls the position of TEXT,
02025     the size of the arrowheads, and the amount the ends of 
02026     linear dimension's extension lines extend beyond the 
02027     dimension lines.
02028 
02029     Leaders:
02030 
02031       Polyline with N=m_points.Count() points (N >= 2).
02032 
02033                       [N-2] ----- [N-1] TEXT
02034                         /         (tail)
02035                        /
02036                       /
02037             [1]------[2]
02038             /
02039            /
02040           /
02041         [0] (arrow)
02042 
02043       Leaders ignore the m_userpositionedtext setting.  If the
02044       default leader text handling is not adequate, then use
02045       a leader with no text and an ON_TextEntity2.
02046   */
02047 
02048   enum POINT_INDEX
02049   {
02050     // Do not change these enum values.  They are saved in files as the 
02051     // ON_COMPONENT_INDEX.m_index value.
02052     //
02053     // Indices of leader definition points in 
02054     // the m_points[] array
02055     arrow_pt_index  = 0, // arrow tip
02056 
02057     // Points calculated from values in m_points[]
02058     text_pivot_pt = 10000, // start/end of dimension text at tail
02059     tail_pt       = 10001
02060   };
02061 
02062   // Constructors
02063   ON_Leader2();
02064   ~ON_Leader2();
02065   // C++ automatically provides the correct copy constructor and operator= .
02066   //ON_Leader2(const ON_Leader2&);
02067   //ON_Leader2& operator=(const ON_Leader2&);
02068 
02069   // overrides virtual ON_Geometry::Transform()
02070   ON_BOOL32 Transform( const ON_Xform& xform );
02071 
02072   /*
02073   Description:
02074     Get the m_plane coordinates of the dimension point.
02075   Parameters:
02076     point_index - [in] One of the POINT_INDEX enum values
02077   Returns:
02078     2d point or ON_UNSET_POINT if point_index or m_points[]
02079     array is not valid.
02080   */
02081   ON_2dPoint Dim2dPoint(
02082        int point_index
02083        ) const;
02084 
02085   /*
02086   Description:
02087     Get the m_plane coordinates of the dimension point.
02088   Parameters:
02089     point_index - [in] One of the POINT_INDEX enum values
02090   Returns:
02091     2d point or ON_UNSET_POINT if point_index or m_points[]
02092     array is not valid.
02093   */
02094   ON_3dPoint Dim3dPoint(
02095        int point_index
02096        ) const;
02097 
02098   // overrides virual ON_Object::IsValid
02099   ON_BOOL32 IsValid( ON_TextLog* text_log = 0 ) const;
02100 
02101   // overrides virual ON_Object::Write
02102   ON_BOOL32 Write(ON_BinaryArchive&) const;
02103 
02104   // overrides virual ON_Object::Read
02105   ON_BOOL32 Read(ON_BinaryArchive&);
02106 
02107   // overrides virual ON_Geometry::GetBBox
02108   ON_BOOL32 GetBBox(
02109          double*,
02110          double*,
02111          ON_BOOL32 = false
02112          ) const;
02113 
02114   // overrides virual ON_Geometry::GetTightBoundingBox
02115         bool GetTightBoundingBox( 
02116                         ON_BoundingBox& tight_bbox, 
02117       int bGrowBox = false,
02118                         const ON_Xform* xform = 0
02119       ) const;
02120 
02121   /*
02122     Description:
02123       Add or delete points to the leader
02124     Parameters:
02125       index [in] the point to delete
02126       point [in]  The point to add
02127     Returns:
02128       @untitled table
02129       true     Success
02130       False    Failure
02131   */
02132   void AddPoint( const ON_2dPoint& point);
02133   bool RemovePoint( int index = -1);
02134 
02135   /*
02136     Description:
02137       Converts an ON_Leader2 to the v2 form ON_Leader
02138     Parameters:
02139       leader [out] - the result of the conversion
02140   */
02141   void GetV2Form( ON_Leader& leader);
02142   bool CreateFromV2( 
02143       const ON_Annotation& v2_ann,
02144       const ON_3dmAnnotationSettings& settings,
02145       int dimstyle_index
02146       );
02147 
02148 // April 22, 2010 Lowell - Added to support right justified text on left pointing leader tails rr64292
02149   bool GetTextDirection( ON_2dVector& text_dir ) const;
02150   bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
02151   bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
02152 };
02153 
02154 
02155 /*
02156   A simple dot with text that doesn't rotate witn the world axes
02157 */
02158 class ON_CLASS ON_TextDot : public ON_Geometry
02159 {
02160   ON_OBJECT_DECLARE(ON_TextDot);
02161 
02162 public:
02163   ON_TextDot();
02164   ~ON_TextDot();
02165   // C++ automatically provides the correct copy constructor and operator= .
02166   //ON_TextDot( const ON_TextDot& src);
02167   //ON_TextDot& operator=( const ON_TextDot& src);
02168 
02169   void EmergencyDestroy();
02170 
02171   //---------------------------
02172   // ON_Object overrides
02173 
02174   /*
02175   Description:
02176     Tests an object to see if its data members are correctly
02177     initialized.
02178   Paramters:
02179     text_log - [in] if the object is not valid and text_log
02180         is not NULL, then a brief english description of the
02181         reason the object is not valid is appened to the log.
02182         The information appended to text_log is suitable for
02183         low-level debugging purposes by programmers and is
02184         not intended to be useful as a high level user
02185         interface tool.
02186   Returns:
02187     @untitled table
02188     true     object is valid
02189     false    object is invalid, uninitialized, etc.
02190   Remarks:
02191     Overrides virtual ON_Object::IsValid
02192   */
02193   ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const;
02194 
02195   /*
02196     Description: Write data values to a text file for debugging
02197   */
02198   void Dump( ON_TextLog& log) const;
02199 
02200   /*
02201     Description: Writes the object to a file
02202 
02203     Returns:
02204       @untitled Table
02205       true     Success
02206       false    Failure
02207   */
02208   ON_BOOL32 Write( ON_BinaryArchive& ar) const;
02209 
02210   /*
02211     Description: Reads the object from a file
02212 
02213     Returns:
02214       @untitled Table
02215       true     Success
02216       false    Failure
02217   */
02218   ON_BOOL32 Read( ON_BinaryArchive& ar);
02219 
02220   /*
02221     Returns: The Object Type of this object
02222   */
02223   ON::object_type ObjectType() const;
02224 
02225   //---------------------------
02226   // ON_Geometry overrides
02227 
02228   /*
02229     Returns the geometric dimension of the object ( usually 3)
02230   */
02231   int Dimension() const;
02232 
02233   /*
02234     Description:
02235       Get a bounding 3d WCS box of the object
02236     Parameters:
02237       [in/out] double* boxmin - pointer to dim doubles for min box corner
02238       [in/out] double* boxmax - pointer to dim doubles for max box corner
02239       [in] ON_BOOL32 growbox   - true to grow the existing box,
02240                             false ( the default) to reset the box
02241     Returns:
02242       true = Success
02243       false = Failure
02244     Remarks:
02245       Since the bounding box of this entity changes size at different
02246       zoom levels, the bounding box is a point at the definition point
02247   */
02248   ON_BOOL32 GetBBox( double* box_min, double* box_max, ON_BOOL32 grow_box = false) const;
02249 
02250   /*
02251     Description:
02252       Transform the object by a 4x4 xform matrix
02253     Parameters:
02254       [in] xform  - An ON_Xform with the transformation information
02255     Returns:
02256       true = Success
02257       false = Failure
02258     Remarks:
02259       The object has been transformed when the function returns
02260   */
02261   ON_BOOL32 Transform( const ON_Xform& xform);
02262 
02263   // virtual ON_Geometry::IsDeformable() override
02264   bool IsDeformable() const;
02265 
02266   // virtual ON_Geometry::MakeDeformable() override
02267   bool MakeDeformable();
02268 
02269   const ON_3dPoint& Point() const;
02270   void SetPoint( const ON_3dPoint& point);
02271 
02272   int Height() const;
02273   void SetHeight( int);
02274 
02275   const wchar_t* TextString() const;
02276   void SetTextString( const wchar_t* string);
02277 
02278   const wchar_t* FontFace() const;
02279   void SetFontFace( const wchar_t* face);
02280 
02281   
02282   /*
02283     Description:
02284       Get or Set whether the dot is drawn "On Top" of other geometry
02285     Parameters:
02286       [in] bTop  bool - It is or isn't on top
02287     Returns:
02288       @untitled table
02289       true - on top
02290       false - not on top
02291   */
02292   void SetAlwaysOnTop(bool bTop);
02293   bool AlwaysOnTop() const;
02294 
02295   /*
02296     Description:
02297       Get or Set whether the dot is drawn with a transparent background
02298     Parameters:
02299       [in] bTransparent  bool - It is or isn't transparent
02300     Returns:
02301       @untitled table
02302       true - transparent
02303       false - not transparent
02304   */
02305   void SetTransparent(bool bTransparent);
02306   bool Transparent() const;
02307 
02308   /*
02309     Description:
02310       Get or Set whether the dot is drawn with Bold text
02311     Parameters:
02312       [in] bBold  bool - It is or isn't Bold
02313     Returns:
02314       @untitled table
02315       true - Bold
02316       false - not Bold
02317   */
02318   void SetBold(bool bBold);
02319   bool Bold() const;
02320 
02321   /*
02322     Description:
02323       Get or Set whether the dot is drawn with Italic text
02324     Parameters:
02325       [in] bItalic  bool - It is or isn't Italic
02326     Returns:
02327       @untitled table
02328       true - Italic
02329       false - not Italic
02330   */
02331   void SetItalic(bool bItalic);
02332   bool Italic() const;
02333 
02334 
02335   ON_3dPoint m_point;
02336   int m_height;        // in points
02337   ON_wString m_text;
02338   ON_wString m_fontface;
02339   int m_display;       // some future display flags - 
02340 };
02341 
02342 
02343 
02344 #endif
02345 
02346 


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:26:59