rvc/style.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/style.h 
00003  * \brief interface for the RVC::STYLE class.
00004  *
00005  * \if NODOC
00006  * $Id: style.h_v 1.56 2003/10/31 15:41:35 mju Exp $
00007  *
00008  * $Log: style.h_v $
00009  * Revision 1.56  2003/10/31 15:41:35  mju
00010  * Change DlgGetPattern to just have const mistring& for prompt.
00011  *
00012  * Revision 1.55  2003/10/15 16:27:50  scowan
00013  * Added more standard filters.
00014  *
00015  * Revision 1.54  2003/10/14 21:52:50  scowan
00016  * Added is selectable filter.
00017  *
00018  * Revision 1.53  2003/10/08 22:18:13  scowan
00019  * Doxygen.
00020  *
00021  * Revision 1.52  2003/10/07 17:30:20  scowan
00022  * Object virtual method changes.
00023  *
00024  * Revision 1.51  2003/10/03 20:15:16  linux32build!build
00025  * Don't capitalize enum any more. Genitor needed it, Doxygen doesn't like it.
00026  *
00027  * Revision 1.50  2003/09/30 16:52:06  dwilliss
00028  * Doxygen
00029  *
00030  * Revision 1.49  2003/09/25 21:20:04  dwilliss
00031  * Fixed doxygen comment
00032  *
00033  * Revision 1.48  2003/09/15 13:49:45  fileserver!dwilliss
00034  * Doxygen
00035  *
00036  * Revision 1.47  2003/09/08 20:25:57  dwilliss
00037  * Added doxygen tags for function groups
00038  *
00039  * Revision 1.46  2003/07/15 15:40:13  dwilliss
00040  * Gave HATCHPATTERN, BITMAPPATTERN and SYMBOLPATTERN copy constructors and
00041  * assignment operators.
00042  *
00043  * Revision 1.45  2003/03/19 22:38:56  scowan
00044  * Added unique filters for styles and patterns.
00045  *
00046  * Revision 1.44  2003/03/13 22:11:54  mju
00047  * Move pattern element offset array to base class protected so can clear on read.
00048  *
00049  * Revision 1.43  2003/03/04 16:53:45  scowan
00050  * Added write pattern name.
00051  *
00052  * Revision 1.42  2003/03/03 15:21:24  mju
00053  * nc.
00054  *
00055  * Revision 1.41  2003/02/27 18:53:58  mju
00056  * Make bitmappattern::create non-inline and remove unimplemented DeleteUnusedColors.
00057  *
00058  * Revision 1.40  2003/02/24 17:29:51  mju
00059  * Had comparison reversed in setOffsetAside.
00060  *
00061  * Revision 1.39  2003/02/24 15:02:24  mju
00062  * In line pattern get/set OffsetAside flip sign for non-line elements so consistent.
00063  *
00064  * Revision 1.38  2003/02/20 19:02:20  mju
00065  * Add linepattern iterator dtor.
00066  *
00067  * Revision 1.37  2003/02/06 21:33:46  scowan
00068  * nc.
00069  *
00070  * Revision 1.36  2003/01/31 18:48:30  mju
00071  * Add parm to TableEditStyleAssignment for optional dft style obj item.
00072  *
00073  * Revision 1.35  2003/01/30 23:04:33  mju
00074  * Allow dft ctor/op= for linepattern::element_shared since behavior would be correct.
00075  *
00076  * Revision 1.34  2003/01/30 22:36:55  mju
00077  * In style editor allow return of modified dftstyle.
00078  *
00079  * Revision 1.33  2003/01/30 18:27:18  mju
00080  * Use explicit on element_shared ctor.
00081  *
00082  * Revision 1.32  2003/01/24 17:20:37  mju
00083  * *** empty log message ***
00084  *
00085  * Revision 1.31  2003/01/24 16:42:41  mju
00086  * Try again to fix for Unix.
00087  *
00088  * Revision 1.30  2003/01/24 14:09:58  mju
00089  * Attempt to fix Unix compile problem.
00090  *
00091  * Revision 1.29  2003/01/23 22:37:48  mju
00092  * Add LINEPATTERN element stuff, iterator, etc.
00093  *
00094  * Revision 1.28  2002/10/14 16:28:01  mju
00095  * Fix EDITSTYLEFLAGS.
00096  *
00097  * Revision 1.27  2002/10/14 15:06:16  mju
00098  * Reorganize EDITSTYLEFLAGS.
00099  *
00100  * Revision 1.26  2002/10/04 17:50:46  mju
00101  * Add Dlg for editing cad style by attrib.
00102  *
00103  * Revision 1.25  2002/08/22 14:24:47  scowan
00104  * nc.
00105  *
00106  * Revision 1.24  2002/08/21 20:39:16  scowan
00107  * Deprecate old object name define.
00108  *
00109  * Revision 1.23  2002/08/13 13:28:59  mju
00110  * Change dlggetpatterns naming.
00111  *
00112  * Revision 1.22  2002/08/12 13:29:36  mju
00113  * Add DlgStyleEdit and DlgTableEdit... fns.
00114  *
00115  * Revision 1.21  2002/05/24 16:30:50  scowan
00116  * Fixed base pattern allocations.
00117  *
00118  * Revision 1.20  2002/05/23 22:28:37  scowan
00119  * Added more pattern methods.
00120  *
00121  * Revision 1.19  2002/05/23 20:44:16  scowan
00122  * Added multiple methods.
00123  *
00124  * Revision 1.18  2002/04/11 19:24:31  scowan
00125  * Added multiple methods dealing with in-memory style structures.
00126  *
00127  * Revision 1.17  2001/10/24 16:18:49  scowan
00128  * Changed return types of delete methods.
00129  *
00130  * Revision 1.14  2001/09/04 17:10:28  mju
00131  * Add DlgEditPattern/PatternSet method defns.
00132  *
00133  * Revision 1.13  2001/08/31 20:04:22  scowan
00134  * Nothing.
00135  *
00136  * Revision 1.12  2001/08/31 19:26:31  mju
00137  * Add WriteStyleName() method defn.
00138  *
00139  * Revision 1.11  2001/08/31 15:57:05  mju
00140  * Use const in FindFontName().
00141  *
00142  * Revision 1.10  2001/08/28 14:56:39  mju
00143  * Change StyleAdd to return style number.
00144  *
00145  * Revision 1.9  2001/08/27 14:53:28  mju
00146  * Use DEFINE_ENUM_OP_INCREMENT on style type.
00147  * Fix inclusion guard name.
00148  *
00149  * Revision 1.8  2001/06/14 16:13:02  scowan
00150  * Changed source type.
00151  *
00152  * Revision 1.7  2001/06/13 22:11:43  scowan
00153  * Added to RVC namespace.
00154  *
00155  * Revision 1.6  2001/06/13 15:04:20  scowan
00156  * Added new make method.
00157  *
00158  * Revision 1.5  2001/06/13 15:02:03  scowan
00159  * Changed enum value.
00160  *
00161  * Revision 1.4  2000/12/01 16:01:45  scowan
00162  * Fixed MAC errors.
00163  *
00164  * Revision 1.3  2000/11/16 17:55:51  scowan
00165  * Different inclusion guards for this file.
00166  *
00167  * Revision 1.1  2000/09/29 15:49:58  scowan
00168  * Initial revision
00169  * \endif
00170 **/
00171 
00172 #ifndef INC_RVC_STYLE_H
00173 #define INC_RVC_STYLE_H
00174 
00175 #ifndef INC_RVC_OBJECT_H
00176    #include <rvc/object.h>
00177 #endif
00178 
00179 #ifndef INC_MI32_RVCSTYLE_H
00180    #include <mi32/rvcstyle.h>
00181 #endif
00182 
00183 #ifndef INC_MI32_ELEMTYPE_H
00184    #include <mi32/elemtype.h>
00185 #endif
00186 
00187 #ifndef INC_MI32_SIMPLEAR_H
00188    #include <mi32/simplear.h>
00189 #endif
00190 
00191 #ifndef INC_MI32_ELEMSTYL_H
00192    #include <mi32/elemstyl.h>
00193 #endif
00194 
00195 #ifndef INC_MI32_MGD2_H
00196    #include <mi32/mgd2.h>
00197 #endif
00198 
00199 #ifndef INC_RVC_GETOBJF_H
00200    #include <rvc/getobjf.h>
00201 #endif
00202 
00203 namespace RVC {
00204 
00205 //!   \class STYLE rvc/style.h
00206 //!   \brief Manages RVC::OBJTYPE_Style RVC objects.
00207 //!   
00208 //!   RVC Object Types that this class supports: RVC::OBJTYPE_Style.
00209 //!
00210 //!   Default RVC Object Type for this class: RVC::OBJTYPE_Style.
00211 //!
00212 //!   Valid parents for this class:
00213 //!      - RVC::OBJTYPE_File
00214 //!      - RVC::OBJTYPE_Folder
00215 //!      - RVC::OBJTYPE_Vector
00216 //!      - RVC::OBJTYPE_TIN
00217 //!      - RVC::OBJTYPE_CAD
00218 //!      - RVC::OBJTYPE_Table
00219 //!      - RVC::OBJTYPE_Raster
00220 //!      - RVC::OBJTYPE_Hyperspectral
00221 //!      - RVC::OBJTYPE_Script_SML
00222 //!      - RVC::OBJTYPE_Script_Query
00223 //!      - RVC::OBJTYPE_Theme
00224 
00225 class STYLE : public RVC::OBJECT {
00226    public:
00227    
00228       #ifndef GENERATING_DOXYGEN_OUTPUT
00229       class BASEPATTERN;
00230       class BITMAPPATTERN;
00231       class HATCHPATTERN;
00232       class GETOBJFILTER_ISSELECTABLE;
00233       class GETOBJFILTER_HASPATTERNTYPE;
00234       class GETOBJFILTER_HASSTYLETYPE;
00235       class LINEPATTERN;
00236       class SYMBOLPATTERN;
00237       class UNIQUEPATTERNNAMEFILTER;
00238       class UNIQUESTYLENAMEFILTER;
00239       #endif // GENERATING_DOXYGEN_OUTPUT
00240       
00241       //! Style type.
00242       enum TYPE {
00243          TYPE_Point = 0,
00244          TYPE_Line,
00245          TYPE_Polygon,
00246          TYPE_Text,
00247          TYPE_NumTypes
00248          };
00249 
00250       //! Pattern type.
00251       enum PATTERN {
00252          PATTERN_Symbol = 0,
00253          PATTERN_Line,
00254          PATTERN_Bitmap,
00255          PATTERN_Hatch,
00256          PATTERN_NumTypes
00257          };
00258 
00259       //! Default constructor
00260       STYLE (
00261          );
00262 
00263       //! Copy constructor
00264       STYLE (
00265          const RVC::STYLE& obj
00266          );
00267 
00268       //! Destructor
00269       virtual ~STYLE (
00270          );
00271 
00272       //! Assignment.  Will close if necessary and reopen if 'rhs' is open
00273       RVC::STYLE& operator= (
00274          const RVC::STYLE& rhs
00275          );
00276 
00277       //! Add pattern to rvc style object
00278       //! @return New pattern number
00279       INT32 AddPattern (
00280          PATTERN PattType,             //!< Type of pattern to add
00281          void *Pattern                 //!< Pattern to add
00282          );
00283                               
00284       //! Add pattern to rvc style object
00285       //! @return New pattern number
00286       INT32 AddPattern (
00287          PATTERN PattType,          //!< Type of pattern to add
00288          const BASEPATTERN& Pattern             //!< Pattern to add
00289          );
00290          
00291       //! Add pattern to rvc style object
00292       //! @return New pattern number
00293       INT32 AddPattern (
00294          const BITMAPPATTERN& Pattern              //!< Pattern to add
00295          );
00296          
00297       //! Add pattern to rvc style object
00298       //! @return New pattern number
00299       INT32 AddPattern (
00300          const HATCHPATTERN& Pattern               //!< Pattern to add
00301          );
00302          
00303       //! Add pattern to rvc style object
00304       //! @return New pattern number
00305       INT32 AddPattern (
00306          const LINEPATTERN& Pattern             //!< Pattern to add
00307          );
00308          
00309       //! Add pattern to rvc style object
00310       //! @return New pattern number
00311       INT32 AddPattern (
00312          const SYMBOLPATTERN& Pattern              //!< Pattern to add
00313          );
00314          
00315       //! Add point style to rvc style object   
00316       //! @return New style number or error < 0.
00317       INT32 AddStyle (           
00318          RVCPOINTSTYLE& style          //!< Point style to add
00319          );
00320                               
00321       //! Add point style to rvc style object   
00322       //! @return New style number or error < 0.
00323       INT32 AddStyle (
00324          const RVC::OBJECTNAME& name,
00325          const POINTSTYLE& style          //!< Point style to add
00326          );
00327                               
00328       //! Add polygon style to rvc style object 
00329       //! @return New style number or error < 0.
00330       INT32 AddStyle (           
00331          RVCPOLYSTYLE& style           //!< Polygon style to add
00332          );
00333                               
00334       //! Add polygon style to rvc style object 
00335       //! @return New style number or error < 0.
00336       INT32 AddStyle (
00337          const RVC::OBJECTNAME& name,
00338          const POLYSTYLE& style           //!< Polygon style to add
00339          );
00340                               
00341       //! Add line style to rvc style object    
00342       //! @return New style number or error < 0.
00343       INT32 AddStyle (           
00344          RVCLINESTYLE& style           //!< Line style to add
00345          );
00346                               
00347       //! Add line style to rvc style object 
00348       //! @return New style number or error < 0.
00349       INT32 AddStyle (
00350          const RVC::OBJECTNAME& name,
00351          const LINESTYLE& style           //!< Line style to add
00352          );
00353                               
00354       //! Add text style to rvc style object    
00355       //! @return New style number or error < 0.
00356       INT32 AddStyle (           
00357          RVCTEXTSTYLE& style           //!< Text style to add
00358          );
00359 
00360       //! Add text style to rvc style object 
00361       //! @return New style number or error < 0.
00362       INT32 AddStyle (
00363          const RVC::OBJECTNAME& name,
00364          const TEXTSTYLE& style           //!< Text style to add
00365          );
00366 
00367       //! Combine two style objects together using 'this' as the source and either findint or making
00368       //! the destination style object.  The destination style object is returned in 'DestStyleObj'.
00369       ERRVALUE Combine (
00370          const RVC::OBJECT& DestParentObj,            //!< Parent object to combine / copy to
00371          RVC::STYLE& DestStyleObj,                    //!< Destination object created or found
00372          SIMPLE_ARRAY<INT32>& FontTrans,
00373          SIMPLE_ARRAY<INT32> PattTrans[PATTERN_NumTypes]
00374          );
00375          
00376       //! Combine two style objects together using 'this' as the source and either findint or making
00377       //! the destination style object.  The destination style object is returned in 'DestStyleObj'.
00378       ERRVALUE Combine (
00379          const RVC::OBJECT& DestParentObj,            //!< Parent object to combine / copy to
00380          RVC::STYLE& DestStyleObj                     //!< Destination object created or found
00381          );
00382          
00383       //! Convert between memory and rvc line styles        
00384       void ConvertStyle (
00385          RVCLINESTYLE& rvcstyle,
00386          const LINESTYLE& linestyle
00387          ) const;
00388          
00389       //! Convert between memory and rvc line styles        
00390       void ConvertStyle (
00391          LINESTYLE& linestyle,
00392          const RVCLINESTYLE& rvcstyle
00393          ) const;
00394          
00395       //! Convert between memory and rvc point styles       
00396       void ConvertStyle (
00397          RVCPOINTSTYLE& rvcstyle,
00398          const POINTSTYLE& pointstyle
00399          ) const;
00400          
00401       //! Convert between memory and rvc point styles       
00402       void ConvertStyle (
00403          POINTSTYLE& pointstyle,
00404          const RVCPOINTSTYLE& rvcstyle
00405          ) const;
00406          
00407       //! Convert between memory and rvc polygon styles        
00408       void ConvertStyle (
00409          RVCPOLYSTYLE& rvcstyle,
00410          const POLYSTYLE& polystyle
00411          ) const;
00412          
00413       //! Convert between memory and rvc polygon styles        
00414       void ConvertStyle (
00415          POLYSTYLE& polystyle,
00416          const RVCPOLYSTYLE& rvcstyle
00417          ) const;
00418          
00419       //! Convert between memory and rvc text styles        
00420       void ConvertStyle (
00421          RVCTEXTSTYLE& rvcstyle,
00422          const TEXTSTYLE& textstyle
00423          );             //! Not const, can change object
00424          
00425       //! Convert between memory and rvc text styles        
00426       void ConvertStyle (
00427          TEXTSTYLE& textstyle,
00428          const RVCTEXTSTYLE& rvcstyle
00429          ) const;
00430          
00431       //! Delete pattern from rvc style object, modifies styles that referenced the pattern
00432       //! @return Pattern number that replaced the deleted pattern or <0 if error
00433       INT32 DeletePattern (
00434          PATTERN PattType,             //!< Type of pattern to delete
00435          INT32 PattNum                 //!< Pattern index to delete
00436          );
00437 
00438       //! Delete style from rvc style object
00439       //! @return Style number that replaced the deleted style or <0 if error
00440       INT32 DeleteStyle (
00441          TYPE StyleType,               //!< Type of style to delete
00442          INT32 StyleNum                //!< Style index to delete
00443          );
00444 
00445       //! Delete all styles of a specified type from rvc style object
00446       ERRVALUE DeleteStyleType (
00447          TYPE StyleType                //!< Type of style to delete
00448          );
00449 
00450       //! Locate a font based on a font name and initial position
00451       //! @return Index of font name if found, -1 if none found, < -1 error code
00452       INT32 FindFontName (
00453          INT32 start,                  //!< Best guess of initial font location
00454          const MISTRING& name          //!< Font to search for
00455          ) const;
00456 
00457       //! Locate a font based on a font name and initial position
00458       //! @return Index of font name if found, -1 if none found, < -1 error code
00459       INT32 FindFontName (
00460          INT32 start,                  //!< Best guess of initial font location
00461          const TEXTFONTNAME& name      //!< Font to search for
00462          ) const;
00463 
00464       //! Add a font name to the font name list
00465       //! @return Index of added font name or error if < 0
00466       INT32 FontTransAdd (
00467          const MISTRING& name          //!< Name of font to add
00468          );
00469 
00470       //! Add a font name to the font name list
00471       //! @return Index of added font name or error if < 0
00472       INT32 FontTransAdd (
00473          const TEXTFONTNAME& name            //!< Name of font to add
00474          );
00475 
00476       //! Obtain font handle from a font index
00477       //! @return font handle of error if < 0
00478       INT32 FontTransIndexToHandle (
00479          INT32 FontNum                 //!< Font index to translate into a font handle
00480          );
00481 
00482       //! Obtain font index from a font name
00483       //! @return font index of error if < 0
00484       ERRVALUE FontTransIndexToName (
00485          INT32 FontNum,          
00486          MISTRING& name                //!< Name of font to translate into an index
00487          ) const;
00488 
00489       //! Obtain font index from a font name
00490       //! @return font index of error if < 0
00491       ERRVALUE FontTransIndexToName (
00492          INT32 FontNum,          
00493          TEXTFONTNAME& name                  //!< Name of font to translate into an index
00494          ) const;
00495 
00496       //! Find a pattern given a name and the pattern type
00497       //! @return -1 if pattern not found, >= 0 Pattern index if found, < -1 error
00498       INT32 FindPattern (
00499          PATTERN PattType,             //!< Type of pattern to search for
00500          INT32 StartPattNum,           //!< Best guess of initial pattern location
00501          const RVC::OBJECTNAME& name   //!< Name of pattern to find
00502          ) const;
00503 
00504       //! Find a style given a name and the style type
00505       //! @return -1 if style not found, >= 0 Style index if found, < -1 error
00506       INT32 FindStyle (
00507          TYPE StyleType,               //!< Type of style to search for
00508          INT32 StartStyleNum,          //!< Best guess of initial style location
00509          const RVC::OBJECTNAME& name   //!< Name of style to find
00510          ) const;
00511 
00512       //! Obtain the number of font names in the list
00513       //! @return Number of font names
00514       INT32 GetFontNameCount (
00515          ) const;
00516 
00517       //! Obtain the number of patterns of a specific pattern type
00518       //! @return Number of patterns of the requested pattern type or < 0 if error
00519       INT32 GetPatternCount (
00520          PATTERN PattType              //!< Type of pattern to get count of
00521          ) const;
00522 
00523       //! Obtain the maximum pattern size of a specific pattern type
00524       //! @return Maximum pattern size of the requested pattern type or < 0 if error
00525       INT32 GetPatternMaxSize (
00526          PATTERN PattType              //!< Type of pattern to get the maximum size of
00527          ) const;
00528 
00529       //! Obtain the pattern size of a specific pattern type
00530       //! @return Pattern size of the requested pattern type or < 0 if error
00531       INT32 GetPatternSize (
00532          PATTERN PattType,             //!< Type of pattern to get the size of
00533          INT32 PattNum                 //!< Pattern index to get the size of
00534          ) const;
00535 
00536       //! Obtain the number of styles of a specific style type
00537       //! @return Number of styles of the requested style type or < 0 if error
00538       INT32 GetStyleCount (
00539          TYPE StyleType                //!< Type of style to get count of
00540          ) const;
00541 
00542       //! Create a new rvc style object under a specified parent rvc object with name, description, and source
00543       ERRVALUE Make (
00544          const RVC::OBJECT& parent,    //!< Parent object to create style object under
00545          const RVC::OBJECTNAME& name,  //!< Name of new style object
00546          const RVC::OBJECTDESC& desc,  //!< Description of new style object
00547          const char* Source = 0        //!< Source of new style object, default is application name
00548          );
00549 
00550       //! Create a new rvc style object under a specified parent rvc object with name, description, and source
00551       ERRVALUE Make (
00552          const RVC::OBJITEM& ObjItem,  //!< Name, Desc of object to create 
00553          const char* Source = 0        //!< Source of new style object, default is application name
00554          );
00555 
00556       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00557       ERRVALUE ReadPattern (
00558          PATTERN PattType,             //!< Type of pattern to read
00559          INT32 PatternNum,             //!< Index of pattern to read
00560          void *Pattern                 //!< Pattern buffer to read into
00561          ) const;
00562       
00563       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00564       ERRVALUE ReadPattern (
00565          PATTERN PattType,             //!< Type of pattern to read
00566          INT32 PatternNum,             //!< Index of pattern to read
00567          BASEPATTERN& Pattern          //!< Pattern buffer to read into
00568          ) const;
00569       
00570       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00571       ERRVALUE ReadPattern (
00572          INT32 PatternNum,             //!< Index of pattern to read
00573          BITMAPPATTERN& Pattern           //!< Pattern buffer to read into
00574          ) const;
00575       
00576       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00577       ERRVALUE ReadPattern (
00578          INT32 PatternNum,             //!< Index of pattern to read
00579          HATCHPATTERN& Pattern            //!< Pattern buffer to read into
00580          ) const;
00581       
00582       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00583       ERRVALUE ReadPattern (
00584          INT32 PatternNum,             //!< Index of pattern to read
00585          LINEPATTERN& Pattern          //!< Pattern buffer to read into
00586          ) const;
00587       
00588       //! Read a pattern into a buffer.  The format of the pattern is pattern type specific
00589       ERRVALUE ReadPattern (
00590          INT32 PatternNum,             //!< Index of pattern to read
00591          SYMBOLPATTERN& Pattern           //!< Pattern buffer to read into
00592          ) const;
00593       
00594       //! Read a pattern header into a buffer.
00595       ERRVALUE ReadPatternHdr (
00596          PATTERN PattType,             //!< Type of pattern to read
00597          INT32 PatternNum,             //!< Index of pattern to read
00598          void *PattHdr                 //!< Pattern header buffer to read into
00599          ) const;
00600 
00601       //! Read a pattern name
00602       ERRVALUE ReadPatternName (
00603          PATTERN PattType,             //!< Type of pattern to read
00604          INT32 PattNum,                //!< Index of pattern to read
00605          RVC::OBJECTNAME& name         //!< Place to store pattern name
00606          ) const;
00607 
00608       //! Read a point style item
00609       ERRVALUE ReadStyle (
00610          INT32 StyleNum,               //!< Index of point style to read
00611          RVCPOINTSTYLE& style          //!< Point style instance to read into
00612          ) const;
00613 
00614       //! Read a point style item
00615       ERRVALUE ReadStyle (
00616          INT32 StyleNum,               //!< Index of point style to read
00617          POINTSTYLE& style          //!< Point style instance to read into
00618          ) const;
00619 
00620       //! Read a polygon style item
00621       ERRVALUE ReadStyle (
00622          INT32 StyleNum,               //!< Index of polygon style to read
00623          RVCPOLYSTYLE& style           //!< Polygon style instance to read into
00624          ) const;
00625 
00626       //! Read a polygon style item
00627       ERRVALUE ReadStyle (
00628          INT32 StyleNum,               //!< Index of polygon style to read
00629          POLYSTYLE& style           //!< Polygon style instance to read into
00630          ) const;
00631 
00632       //! Read a line style item
00633       ERRVALUE ReadStyle (
00634          INT32 StyleNum,               //!< Index of line style to read
00635          RVCLINESTYLE& style           //!< Line style instance to read into
00636          ) const;
00637 
00638       //! Read a line style item
00639       ERRVALUE ReadStyle (
00640          INT32 StyleNum,               //!< Index of line style to read
00641          LINESTYLE& style           //!< Line style instance to read into
00642          ) const;
00643 
00644       //! Read a text style item
00645       ERRVALUE ReadStyle (
00646          INT32 StyleNum,               //!< Index of text style to read
00647          RVCTEXTSTYLE& style           //!< Tezt style instance to read into
00648          ) const;
00649 
00650       //! Read a text style item
00651       ERRVALUE ReadStyle (
00652          INT32 StyleNum,               //!< Index of text style to read
00653          TEXTSTYLE& style           //!< Tezt style instance to read into
00654          ) const;
00655 
00656       //! Read style name given a style type
00657       ERRVALUE ReadStyleName (
00658          TYPE StyleType,               //!< Type of style to get the name of
00659          INT32 StyleNum,               //!< Index of style to get the name of
00660          RVC::OBJECTNAME& name         //!< Place to store style name
00661          ) const;
00662 
00663       //! Write pattern out to rvc style object
00664       ERRVALUE WritePattern (
00665          PATTERN PattType,             //!< Type of pattern to write
00666          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00667          void *Pattern                 //!< Pattern to write
00668          );
00669 
00670       //! Write pattern out to rvc style object
00671       ERRVALUE WritePattern (
00672          PATTERN PattType,             //!< Type of pattern to write
00673          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00674          const BASEPATTERN& Pattern                //!< Pattern to write
00675          );
00676 
00677       //! Write pattern out to rvc style object
00678       ERRVALUE WritePattern (
00679          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00680          const BITMAPPATTERN& Pattern                 //!< Pattern to write
00681          );
00682 
00683       //! Write pattern out to rvc style object
00684       ERRVALUE WritePattern (
00685          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00686          const HATCHPATTERN& Pattern                  //!< Pattern to write
00687          );
00688 
00689       //! Write pattern out to rvc style object
00690       ERRVALUE WritePattern (
00691          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00692          const LINEPATTERN& Pattern                //!< Pattern to write
00693          );
00694 
00695       //! Write pattern out to rvc style object
00696       ERRVALUE WritePattern (
00697          INT32 PatternNum,             //!< Index of pattern to write, Use AddPattern() to write out a new pattern
00698          const SYMBOLPATTERN& Pattern                 //!< Pattern to write
00699          );
00700 
00701       //! Write pattern name given a pattern type.
00702       ERRVALUE WritePatternName (
00703          PATTERN PattType,             //!< Type of pattern to write name
00704          INT32 PatternNum,             //!< Index of pattern to write name
00705          const OBJECTNAME& name        //!< New name of pattern
00706          );
00707    
00708       //! Write point style to rvc style object
00709       ERRVALUE WriteStyle (
00710          INT32 StyleNum,               //!< Index of point style to write.  Use AddStyle() to add a style
00711          RVCPOINTSTYLE& style          //!< Point style to write
00712          );
00713 
00714       //! Write point style to rvc style object
00715       ERRVALUE WriteStyle (
00716          INT32 StyleNum,               //!< Index of point style to write.  Use AddStyle() to add a style
00717          const RVC::OBJECTNAME& name,
00718          const POINTSTYLE& style          //!< Point style to write
00719          );
00720 
00721       //! Write polygon style to rvc style object
00722       ERRVALUE WriteStyle (            
00723          INT32 StyleNum,               //!< Index of polygon style to write.  Use AddStyle() to add a style.
00724          RVCPOLYSTYLE& style           //!< Polygon style to write
00725          );
00726 
00727       //! Write polygon style to rvc style object
00728       ERRVALUE WriteStyle (            
00729          INT32 StyleNum,               //!< Index of polygon style to write.  Use AddStyle() to add a style.
00730          const RVC::OBJECTNAME& name,
00731          const POLYSTYLE& style           //!< Polygon style to write
00732          );
00733 
00734       //! Write line style to rvc style object
00735       ERRVALUE WriteStyle (
00736          INT32 StyleNum,               //!< Index of line style to write.  Use AddStyle() to add a style.
00737          RVCLINESTYLE& style           //!< Line style to write
00738          );
00739 
00740       //! Write line style to rvc style object
00741       ERRVALUE WriteStyle (
00742          INT32 StyleNum,               //!< Index of line style to write.  Use AddStyle() to add a style.
00743          const RVC::OBJECTNAME& name,
00744          const LINESTYLE& style           //!< Line style to write
00745          );
00746 
00747       //! Write text style to rvc style object.
00748       ERRVALUE WriteStyle (
00749          INT32 StyleNum,               //!< Index of text style to write.  Use AddStyle() to add a style.
00750          RVCTEXTSTYLE& style           //!< Text style to write
00751          );
00752 
00753       //! Write text style to rvc style object.
00754       ERRVALUE WriteStyle (
00755          INT32 StyleNum,               //!< Index of text style to write.  Use AddStyle() to add a style.
00756          const RVC::OBJECTNAME& name,
00757          const TEXTSTYLE& style           //!< Text style to write
00758          );
00759 
00760       //! Write style name given a style type.
00761       ERRVALUE WriteStyleName (
00762          TYPE StyleType,               //!< Type of style
00763          INT32 StyleNum,               //!< Index of style
00764          const RVC::OBJECTNAME& name   //!< Style name to write
00765          );
00766 
00767    private:
00768       #ifndef GENERATING_DOXYGEN_OUTPUT
00769 
00770       //! Implementation of RVC::OBJECT virtual methods
00771       virtual ERRVALUE v_CloseObject ();
00772       virtual OBJTYPE v_GetDftObjectType () const;
00773       virtual bool v_IsObjectOpen () const;
00774       virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent);
00775 
00776       int m_StyleID;
00777       #endif // GENERATING_DOXYGEN_OUTPUT
00778 
00779    };
00780 
00781 
00782 //! Base pattern class.
00783 class STYLE::BASEPATTERN {
00784    public:
00785 
00786       //! Default constructor used by style object.
00787       BASEPATTERN (
00788          ) : m_PattBuff(0), m_PattHdrSize(sizeof(RVCPATTHDR)), m_PattBuffSize(sizeof(RVCPATTHDR)), m_BuffSizeAlloc(sizeof(RVCPATTHDR))
00789          { MmAllocCExc((void**)&m_PattBuff, m_PattBuffSize); }
00790          
00791       //! Destructor.
00792       ~BASEPATTERN (
00793          ) { MmFree(m_PattBuff); }
00794 
00795       //! Append color to end of palette.
00796       //! Note, this will invalidate all derived class ITERATORs.
00797       ERRVALUE AppendColor (
00798          const COLOR& color
00799          );
00800 
00801       //! Clear pattern contents.
00802       void Clear (
00803          ) { m_PattBuffSize = m_PattHdrSize; memset(m_PattBuff,0,m_PattHdrSize); }
00804 
00805       //! Get pattern name.         
00806       const RVC::OBJECTNAME& GetName (
00807          ) const { return (*reinterpret_cast<const RVC::OBJECTNAME*>(m_PattBuff)); }
00808 
00809       //! Get color at specified palette index.
00810       const COLOR& GetColor (
00811          UINT8 idx
00812          ) const { return (GetColors()[idx]); }
00813 
00814       //! Get color palette.
00815       const COLOR* GetColors (
00816          ) const { return (reinterpret_cast<COLOR*>(m_PattBuff + m_PattHdrSize)); }
00817          
00818       //! Get number of colors in pattern palette.
00819       INT32 GetNumColors (
00820          ) const { return (reinterpret_cast<const RVCPATTHDR*>(m_PattBuff)->numcolors); }
00821 
00822       //! Get number of pattern elements.
00823       INT32 GetNumElements (
00824          ) const { return (reinterpret_cast<const RVCPATTHDR*>(m_PattBuff)->numelements); }
00825 
00826       //! Get pattern buffer size.
00827       // XXX make protected when possible.
00828       INT32 GetSize (
00829          ) const { return (m_PattBuffSize); }
00830 
00831       //! Set color at specified palette index.
00832       void SetColor (
00833          UINT8 idx,
00834          const COLOR& color
00835          ) { if (idx < GetNumColors()) reinterpret_cast<COLOR*>(m_PattBuff + m_PattHdrSize)[idx] = color; }
00836 
00837       //! Set pattern name.
00838       void SetName (
00839          const OBJECTNAME& name
00840          ) { *reinterpret_cast<RVC::OBJECTNAME*>(m_PattBuff) = name; }
00841 
00842       //! To support legacy code, for now.
00843       // XXX delete when drawing code updated.
00844       operator const void* (
00845          ) const { return (m_PattBuff); }
00846          
00847    protected:
00848 
00849       //! Constructor used by derived classes.
00850       BASEPATTERN (
00851          int PattHdrSize
00852          ) : m_PattBuff(0), m_PattHdrSize(PattHdrSize), m_PattBuffSize(PattHdrSize), m_BuffSizeAlloc(PattHdrSize)
00853          { MmAllocCExc((void**)&m_PattBuff, m_PattBuffSize); }
00854          
00855       //! Copy constructor.
00856       BASEPATTERN (const BASEPATTERN& rhs);
00857 
00858       //! Assignment.
00859       BASEPATTERN& operator= (const BASEPATTERN& rhs);
00860       
00861       //! Delete colors in specified set.
00862       void DeleteColorSet (
00863          const UINT8 *set              //!< Byte array with entries set to non-zero to delete, zero to retain
00864          );
00865 
00866       //! Delete from pattern buffer at specified location.
00867       void DeleteFromBuffer (
00868          INT32 offset,
00869          INT32 numbytes
00870          );
00871 
00872       //! Get const pointer to pattern buffer.
00873       const UINT8* GetPattBuffer (
00874          ) const { return (m_PattBuff); }
00875 
00876       //! Get non-const pointer to pattern buffer.
00877       UINT8* GetPattBuffer (
00878          ) { return (m_PattBuff); }
00879 
00880       //! Get const pointer to first pattern 'element'.
00881       const UINT8* GetFirstElemPtr (
00882          ) const { return (m_PattBuff+m_PattHdrSize+GetNumColors()*sizeof(COLOR)); }
00883 
00884       //! Get non-const pointer to first pattern 'element'.
00885       UINT8* GetFirstElemPtr (
00886          ) { return (m_PattBuff+m_PattHdrSize+GetNumColors()*sizeof(COLOR)); }
00887 
00888       //! Insert space into pattern buffer at specified location
00889       ERRVALUE InsertIntoBuffer (
00890          INT32 offset,
00891          INT32 numbytes,
00892          const void *data = 0
00893          );
00894          
00895       #ifndef GENERATING_DOXYGEN_OUTPUT
00896       UINT8* m_PattBuff;
00897       INT32 m_PattHdrSize;
00898       INT32 m_PattBuffSize;
00899       mutable SIMPLE_ARRAY<UINT32> m_OffsetArray;
00900       #endif // GENERATING_DOXYGEN_OUTPUT
00901       
00902    private:
00903       #ifndef GENERATING_DOXYGEN_OUTPUT
00904 
00905       INT32 m_BuffSizeAlloc;
00906 
00907       friend class STYLE;
00908       #endif // GENERATING_DOXYGEN_OUTPUT
00909    };
00910 
00911 
00912 //! Bitmap pattern class.  
00913 class STYLE::BITMAPPATTERN : public STYLE::BASEPATTERN {
00914    public:
00915 
00916       //! Default constructor.
00917       BITMAPPATTERN (
00918          ) : BASEPATTERN(sizeof(BITMAPPATTHDR)) {}
00919 
00920       //! Copy constructor.
00921       BITMAPPATTERN (
00922          const BITMAPPATTERN& rhs
00923          ) : BASEPATTERN(rhs) {}
00924 
00925       //! Destructor.
00926       ~BITMAPPATTERN (
00927          ) { }
00928 
00929       //! Assignment.
00930       BITMAPPATTERN& operator= (
00931          const BITMAPPATTERN& rhs
00932          ) { if (this != &rhs) { BASEPATTERN::operator=(rhs); } return (*this); }
00933          
00934       ERRVALUE Create (
00935          INT16 xsize,
00936          INT16 ysize
00937          );
00938          
00939       UINT8 GetCell (
00940          INT16 x,
00941          INT16 y
00942          ) const { return (GetFirstElemPtr()[y*GetSizeX()+x]); }
00943 
00944       INT16 GetHotSpotX (
00945          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->xhot); }
00946 
00947       INT16 GetHotSpotY (
00948          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->yhot); }
00949 
00950       INT16 GetIntervalX (
00951          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->xspace); }
00952 
00953       INT16 GetIntervalY (
00954          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->yspace); }
00955 
00956       INT16 GetSizeX (
00957          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->xsize); }
00958 
00959       INT16 GetSizeY (
00960          ) const { return (reinterpret_cast<const BITMAPPATTHDR*>(m_PattBuff)->ysize); }
00961 
00962       void SetCell (
00963          INT16 x,
00964          INT16 y,
00965          UINT8 value
00966          ) { GetFirstElemPtr()[y*GetSizeX()+x] = value; }
00967 
00968       void SetHotSpotX (
00969          INT16 hotspotx
00970          ) { reinterpret_cast<BITMAPPATTHDR*>(m_PattBuff)->xhot = hotspotx; }
00971 
00972       void SetHotSpotY (
00973          INT16 hotspoty
00974          ) { reinterpret_cast<BITMAPPATTHDR*>(m_PattBuff)->yhot = hotspoty; }
00975 
00976       void SetIntervalX (
00977          INT16 intervalx
00978          ) { reinterpret_cast<BITMAPPATTHDR*>(m_PattBuff)->xspace = intervalx; }
00979 
00980       void SetIntervalY (
00981          INT16 intervaly
00982          ) { reinterpret_cast<BITMAPPATTHDR*>(m_PattBuff)->yspace = intervaly; }
00983 
00984    };
00985    
00986 
00987 //! Hatch pattern class.
00988 class STYLE::HATCHPATTERN : public STYLE::BASEPATTERN {
00989    public:
00990       HATCHPATTERN (
00991          ) : BASEPATTERN(sizeof(HATCHPATTHDR)) {}
00992       
00993       //! Copy constructor.
00994       HATCHPATTERN (
00995          const HATCHPATTERN& rhs
00996          ) : BASEPATTERN(rhs) {}
00997 
00998       //! Destructor.
00999       ~HATCHPATTERN (
01000          ) { }
01001 
01002       //! Assignment.
01003       HATCHPATTERN& operator= (
01004          const HATCHPATTERN& rhs
01005          ) { if (this != &rhs) { BASEPATTERN::operator=(rhs); } return (*this); }
01006          
01007    };
01008 
01009 
01010 //! Line pattern class. 
01011 class STYLE::LINEPATTERN : public STYLE::BASEPATTERN {
01012    public:
01013 
01014       enum ELEMENT_TYPE {
01015          ELEMENT_TYPE_Line =        0,
01016          ELEMENT_TYPE_CrossLine =   1,
01017          ELEMENT_TYPE_Circle =      2,
01018          ELEMENT_TYPE_Polyline =    3,
01019          ELEMENT_TYPE_Polygon =     4,
01020          ELEMENT_TYPE_Text =        5,
01021          ELEMENT_TYPE_Symbol =      6,
01022          ELEMENT_TYPE_COUNT
01023          };
01024 
01025       class ITERATOR;
01026       class ELEMENT;
01027 
01028       //! Pattern element referencing shared memory buffer.
01029       //! Primarily used by ITERATOR.
01030       class ELEMENT_SHARED {
01031          public:
01032 
01033             //! Get cap style.
01034             //! @return Line cap style.
01035             MGD::LINECAP GetCapStyle (
01036                ) const { return ((m_pData->flags & LINEPATTFLAG_CapRound) ? MGD::LINECAP_Round : MGD::LINECAP_Butt); }
01037 
01038             //! Get color index.
01039             //! @return Index into color array.
01040             UINT8 GetColorIndex (
01041                ) const { return (m_pData->colornum); }
01042 
01043             //! Get interval between repeated elements.
01044             //! @return Interval in 1/100 millimeter.
01045             INT16 GetInterval (
01046                ) const { return (m_pData->xspacing); }
01047                
01048             MGD::LINEJOIN GetJoinStyle (
01049                ) const { return ((m_pData->flags & LINEPATTFLAG_JoinMiter) ? MGD::LINEJOIN_Miter : (m_pData->flags & LINEPATTFLAG_JoinBevel) ? MGD::LINEJOIN_Bevel : MGD::LINEJOIN_Round); }
01050 
01051             //! Get offset to start of element along line from beginning.
01052             //! @return Offset in 1/100 millimeter.
01053             INT16 GetOffsetAlong (
01054                ) const { return (m_pData->xoffset); }
01055 
01056             //! Get offset aside line (left -, right +).
01057             //! @return Offset in 1/100 millimeter.
01058             INT16 GetOffsetAside (
01059                ) const { return ((m_pData->type != ELEMENT_TYPE_Line) ? -m_pData->yoffset : m_pData->yoffset); }
01060 
01061             //! Get size/length of element.
01062             //! @return Size in 1/100 millimeter.
01063             INT16 GetSize (
01064                ) const { return (m_pData->xsize); }
01065 
01066             //! Get element line thickness.
01067             //! @return Thickness in 1/100 millimeter.
01068             INT16 GetThickness (
01069                ) const { return (m_pData->thickness); }
01070 
01071             //! Get element type.
01072             //! @return Element type.
01073             ELEMENT_TYPE GetType (
01074                ) const { return (static_cast<ELEMENT_TYPE>(m_pData->type)); }
01075 
01076             //! Determine if element is 'filled'.
01077             //! @return 'true' if filled, 'false' if not.
01078             bool IsFilled (
01079                ) const { return ((m_pData->flags & LINEPATTFLAG_Filled) != 0); }
01080 
01081          private:
01082             #ifndef GENERATING_DOXYGEN_OUTPUT
01083 
01084             const LINEPATTELEM *m_pData;
01085             void *m_pExtra;
01086 
01087             //! Default constructor.
01088             ELEMENT_SHARED (
01089                ): m_pData(0), m_pExtra(0) { }
01090 
01091             explicit ELEMENT_SHARED (const void *pElemData)
01092                : m_pData(static_cast<const LINEPATTELEM*>(pElemData)), m_pExtra(static_cast<UINT8*>(const_cast<void*>(pElemData)) + sizeof(LINEPATTELEM))
01093                { }
01094 
01095             //! Destructor.
01096             ~ELEMENT_SHARED (
01097                ) { }
01098 
01099             friend class RVC::STYLE::LINEPATTERN;
01100             friend class ELEMENT;
01101             friend class ITERATOR;
01102             #endif // GENERATING_DOXYGEN_OUTPUT
01103          };
01104 
01105       //! Pattern element.
01106       class ELEMENT : public ELEMENT_SHARED {
01107          public:
01108 
01109             //! Default constructor.
01110             ELEMENT (
01111                ) { memset(&m_MyData,0,sizeof(m_MyData)); m_pData = &m_MyData; }
01112 
01113             //! Copy constructor.
01114             ELEMENT (
01115                const ELEMENT& rhs
01116                );
01117 
01118             //! Construct from ELEMENT_SHARED.
01119             ELEMENT (
01120                const ELEMENT_SHARED& rhs
01121                );
01122 
01123             //! Construct element of specified type.
01124             explicit ELEMENT (
01125                ELEMENT_TYPE type
01126                );
01127 
01128             //! Destructor.
01129             ~ELEMENT (
01130                ) { if (m_pExtra != 0) free(m_pExtra); }
01131 
01132             //! Assignment from ELEMENT.
01133             ELEMENT& operator= (
01134                const ELEMENT& rhs
01135                );
01136 
01137             //! Assignment from ELEMENT_SHARED.
01138             ELEMENT& operator= (
01139                const ELEMENT_SHARED& rhs
01140                );
01141 
01142             //! Set line 'cap style' for dashed and crossing lines.
01143             void SetCapStyle (
01144                MGD::LINECAP linecap
01145                ) { if (linecap == MGD::LINECAP_Round) m_MyData.flags |= LINEPATTFLAG_CapRound; else m_MyData.flags &= ~LINEPATTFLAG_CapRound; }
01146 
01147             //! Set element color index.
01148             void SetColorIndex (
01149                UINT8 idx
01150                ) { m_MyData.colornum = idx; }
01151 
01152             void SetFilled (
01153                bool filled
01154                ) { if (filled) m_MyData.flags |= LINEPATTFLAG_Filled; else m_MyData.flags &= ~LINEPATTFLAG_Filled; }
01155 
01156             void SetInterval (
01157                INT16 interval
01158                ) { m_MyData.xspacing = interval; }
01159 
01160             void SetJoinStyle (
01161                MGD::LINEJOIN linejoin
01162                ) {
01163                m_MyData.flags &= ~(LINEPATTFLAG_JoinMiter|LINEPATTFLAG_JoinBevel);
01164                if (linejoin == MGD::LINEJOIN_Miter) m_MyData.flags |= LINEPATTFLAG_JoinMiter;
01165                else if (linejoin == MGD::LINEJOIN_Bevel) m_MyData.flags |= LINEPATTFLAG_JoinBevel;
01166                }
01167 
01168             void SetOffsetAlong (
01169                INT16 offset
01170                ) { m_MyData.xoffset = offset; }
01171 
01172             void SetOffsetAside (
01173                INT16 offset
01174                ) { m_MyData.yoffset = (m_MyData.type != ELEMENT_TYPE_Line) ? -offset : offset; }
01175 
01176             void SetSize (
01177                INT16 size
01178                ) { m_MyData.xsize = size; }
01179 
01180             void SetThickness (
01181                INT16 thickness
01182                ) { m_MyData.thickness = thickness; }
01183 
01184          private:
01185             #ifndef GENERATING_DOXYGEN_OUTPUT
01186             LINEPATTELEM m_MyData;
01187             #endif // GENERATING_DOXYGEN_OUTPUT
01188          };
01189 
01190       //! Iterator to process pattern elements.
01191       class ITERATOR {
01192          public:
01193 
01194             //! Default constructor.
01195             ITERATOR (
01196                ): m_pEnd(0) { }
01197 
01198             //! Destructor.
01199             ~ITERATOR (
01200                ) { }
01201 
01202             //! Dereference operator, returns reference to ELEMENT_SHARED.
01203             const ELEMENT_SHARED& operator* (
01204                ) const { return (m_element); }
01205 
01206             //! Dereference operator, returns pointer to ELEMENT_SHARED.
01207             const ELEMENT_SHARED* operator-> (
01208                ) const { return (&m_element); }
01209 
01210             //! Pre-increment operator.
01211             ITERATOR& operator++ ();
01212 
01213             //! Equality operator
01214             bool operator== (
01215                const ITERATOR& rhs
01216                ) const { return ((m_pEnd == 0 && rhs.m_pEnd == 0) || m_element.m_pData == rhs.m_element.m_pData); }
01217 
01218             //! Inequality operator
01219             bool operator!= (
01220                const ITERATOR& rhs
01221                ) const { return (!(*this == rhs)); }
01222 
01223          private:
01224             #ifndef GENERATING_DOXYGEN_OUTPUT
01225 
01226             ELEMENT_SHARED m_element;
01227             const void *m_pEnd;
01228 
01229             ITERATOR (const void *pData, const void *pEnd)
01230                : m_element(pData), m_pEnd(pEnd)
01231                { }
01232 
01233             friend class RVC::STYLE::LINEPATTERN;
01234             #endif // GENERATING_DOXYGEN_OUTPUT
01235          };
01236 
01237       //! Default constructor.
01238       LINEPATTERN (
01239          ) : BASEPATTERN(sizeof(LINEPATTHDR)) {}
01240 
01241       //! Copy constructor.
01242       LINEPATTERN (
01243          const LINEPATTERN& rhs
01244          ) : BASEPATTERN(rhs) {}
01245 
01246       //! Destructor.
01247       ~LINEPATTERN (
01248          ) { }
01249 
01250       //! Assignment.
01251       LINEPATTERN& operator= (
01252          const LINEPATTERN& rhs
01253          ) { if (this != &rhs) { BASEPATTERN::operator=(rhs); } return (*this); }
01254 
01255       //! Get iterator for beginning element.
01256       ITERATOR Begin (
01257          ) const { return (ITERATOR(GetFirstElemPtr(),GetPattBuffer()+GetSize())); }
01258 
01259       //! Delete element at specified index.
01260       //! This will invalidate all ITERATORs.
01261       ERRVALUE DeleteElement (
01262          unsigned idx
01263          );
01264 
01265       //! Delete unused colors from pattern palette.
01266       //! This will invalidate all ITERATORs.
01267       void DeleteUnusedColors (
01268          );
01269 
01270       //! Get iterator for end comparison.
01271       ITERATOR End (
01272       #ifdef WIN32
01273          ) const { return (ITERATOR()); }
01274       #else
01275          ) const { ITERATOR it; return (it); }
01276       #endif
01277 
01278       //! Get element at specified index.
01279       //! Note, this is less efficient than using iterator.
01280       ELEMENT GetElement (
01281          unsigned idx
01282          ) const;
01283 
01284       //! Get extent of pattern to 'left' as drawn (not including 'crossing' elements).
01285       INT16 GetExtentLeft (
01286          ) const { return (reinterpret_cast<LINEPATTHDR*>(m_PattBuff)->extentsa); }
01287 
01288       //! Get extent of pattern to 'right' as drawn (not including 'crossing' elements).
01289       INT16 GetExtentRight (
01290          ) const { return (reinterpret_cast<LINEPATTHDR*>(m_PattBuff)->extentsb); }
01291 
01292       //! Insert element at specified index.
01293       //! This will invalidate all ITERATORs.
01294       ERRVALUE InsertElement (
01295          unsigned idx,
01296          const ELEMENT& element
01297          );
01298 
01299       //! Set (replace) element at specified index.
01300       //! If element size changes this will invalidate all ITERATORs.
01301       ERRVALUE SetElement (
01302          unsigned idx,
0