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