layer.h

Go to the documentation of this file.
00001 /**
00002  * \file gre/layer.h
00003  * \brief GRE::LAYER class definition
00004  *
00005  * \if NODOC
00006  * $Id: layer.h_v 1.83 2005/09/02 17:00:21 mju Exp $
00007  *
00008  * $Log: layer.h_v $
00009  * Revision 1.83  2005/09/02 17:00:21  mju
00010  * Add global option for dftRenderMultiPass.
00011  *
00012  * Revision 1.82  2005/05/24 16:12:13  mju
00013  * Add layerflag_DataTipIgnoreDrawnSet.
00014  *
00015  * Revision 1.81  2005/05/11 20:58:18  mju
00016  * Add dispflag_noMergeLegendDups.
00017  *
00018  * Revision 1.80  2005/05/02 17:43:45  mju
00019  * Remove highlightmode for layer.
00020  *
00021  * Revision 1.79  2005/04/29 17:49:30  mju
00022  * Support rendertarget.
00023  *
00024  * Revision 1.78  2005/04/14 19:39:50  mju
00025  * Add dispflag_enableMultiPassRender.
00026  *
00027  * Revision 1.77  2005/03/31 16:57:06  fileserver!dwilliss
00028  * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define
00029  *
00030  * Revision 1.76  2005/03/22 22:00:50  mju
00031  * Add invalidateAllViews.
00032  *
00033  * Revision 1.75  2005/03/07 17:23:15  scowan
00034  * Fixed some unix warnings.
00035  *
00036  * Revision 1.74  2005/03/01 16:50:27  scowan
00037  * Made v_copy pure virtual and created an interface to call it.
00038  * Support v_copy method.
00039  *
00040  * Revision 1.73  2005/03/01 14:20:38  mju
00041  * Add getElemHighlightSet, remove elemsearch stuff.
00042  *
00043  * Revision 1.72  2005/02/25 18:57:47  mju
00044  * Add v_hasHighighlighted.
00045  *
00046  * Revision 1.71  2005/02/25 18:54:20  mju
00047  * Remove layerview defns to own header.
00048  * Add v_Copy virtual method.
00049  *
00050  * Revision 1.70  2005/02/25 17:47:16  mju
00051  * More layerview methods.
00052  *
00053  * Revision 1.69  2005/02/24 18:52:23  mju
00054  * Remove layerview getBackgroundColor.
00055  *
00056  * Revision 1.68  2005/02/23 18:52:32  mju
00057  * Add layerview stuff for highlight device.
00058  * Move labelplacement methods to layerview.
00059  * Add layerview_labeled for common labelplacement handling.
00060  *
00061  * Revision 1.67  2005/02/18 19:06:32  mju
00062  * Changes to layerview for separated rendering.
00063  *
00064  * Revision 1.66  2005/02/17 21:18:55  mju
00065  * Add layerview stuff for separate rendering.
00066  *
00067  * Revision 1.65  2005/02/15 17:50:24  scowan
00068  * No real changes.
00069  *
00070  * Revision 1.64  2005/02/15 17:34:28  scowan
00071  * Do not include grtree unless in x only.
00072  *
00073  * Revision 1.63  2005/02/15 17:22:20  mju
00074  * Add full/used rectangles to layerview.
00075  *
00076  * Revision 1.62  2005/02/14 21:39:36  mju
00077  * Use device in usesTransparency.
00078  *
00079  * Revision 1.61  2005/02/14 18:52:47  mju
00080  * Move some stuff from layerview to groupview.
00081  *
00082  * Revision 1.60  2005/01/27 21:42:32  mju
00083  * Add layerview stuff for labels.
00084  *
00085  * Revision 1.59  2005/01/24 21:31:08  mju
00086  * Move members to layerview from layerdc.
00087  *
00088  * Revision 1.58  2005/01/20 16:54:34  mju
00089  * Enums for createflags, drawmode, highlightmode.
00090  * Add static methods to replace legacy mdisp fns.
00091  * Redesign typedefn class to use textid, iconid, virtual methods, etc.
00092  *
00093  * Revision 1.57  2005/01/12 17:12:42  mju
00094  * Include transformations in layerview.
00095  *
00096  * Revision 1.56  2005/01/04 15:22:53  mju
00097  * Deprecate assign method using fnameinode.
00098  *
00099  * Revision 1.55  2005/01/03 21:46:48  mju
00100  * Add trans and mgd dev to layerview.
00101  *
00102  * Revision 1.54  2004/10/15 21:25:33  ldyas
00103  * added method for needsmem24
00104  *
00105  * Revision 1.49  2004/10/06 13:53:48  mju
00106  * Not necessary to forward-declare inlines for get/set antialias/thinhint methods.
00107  *
00108  * Revision 1.47  2004/10/01 17:19:32  mju
00109  * Add methods for detail density checking.
00110  * Add dlgparent to assignObject.
00111  *
00112  * Revision 1.46  2004/09/29 18:25:42  ldyas
00113  * now when set antialias also set use transparency.
00114  *
00115  * Revision 1.45  2004/09/28 22:17:59  ldyas
00116  * added antialiasing to globals.
00117  *
00118  * Revision 1.43  2004/09/24 00:48:53  ldyas
00119  * added thin line width hinting
00120  *
00121  * Revision 1.41  2004/09/23 22:55:02  ldyas
00122  * added antialiasing to dispparm.
00123  *
00124  * Revision 1.40  2004/09/20 19:11:44  dglasser
00125  * added setOldPrj for sml grelayer.
00126  *
00127  * Revision 1.39  2004/09/03 22:49:50  dwilliss
00128  * Added some members to dispparm
00129  * DrawLabel no longer needs to be virtual
00130  *
00131  * Revision 1.38  2004/08/19 22:19:50  vdronov
00132  * changed transp from 100 to 255
00133  *
00134  * Revision 1.37  2004/08/18 16:25:33  mju
00135  * Make updateExtents non-inline.
00136  *
00137  * Revision 1.35  2004/07/21 21:55:54  mju
00138  * Add layerview support.
00139  *
00140  * Revision 1.31  2004/07/19 22:56:10  dwilliss
00141  * LABELPLACEMENT changes
00142  *
00143  * Revision 1.30  2004/07/14 20:02:22  dwilliss
00144  * Forgot to add the inline wrapper to call a private virtaul method
00145  *
00146  * Revision 1.29  2004/07/13 22:33:03  dwilliss
00147  * Added a virtual method for labels
00148  *
00149  * Revision 1.28  2004/07/12 23:14:34  mju
00150  * Nod georegion.
00151  *
00152  * Revision 1.27  2004/07/07 22:00:34  mju
00153  * Add updateMapRegion.
00154  *
00155  * Revision 1.26  2004/07/07 20:51:29  vdronov
00156  * added SetPedestal and IsPedestalSet
00157  *
00158  * Revision 1.25  2004/06/29 21:35:24  mju
00159  * Add highlightElementsByRegion using region2d.
00160  *
00161  * Revision 1.24  2004/06/28 17:53:20  mju
00162  * Convert to spatref system.
00163  *
00164  * Revision 1.22  2004/06/11 17:48:34  vdronov
00165  * removed flags related to RayCasting
00166  *
00167  * Revision 1.21  2004/06/04 19:20:44  dglasser
00168  * Don't use memset with TEXTSTYLEs in SML.  Added SMLSET_TextStyleMember.
00169  *
00170  * Revision 1.20  2004/05/05 22:49:56  dwilliss
00171  * Started adding support for LABELPLACEMENT
00172  *
00173  * Revision 1.19  2004/04/02 18:54:43  mju
00174  * Add ModifyStamp methods.
00175  *
00176  * Revision 1.18  2004/03/31 21:32:04  mju
00177  * Add DrawElement using rvc::ELEMENT.
00178  *
00179  * Revision 1.17  2004/02/12 22:43:22  dwilliss
00180  * deprecate old mgd
00181  *
00182  * Revision 1.16  2004/02/06 16:23:28  mju
00183  * Reorder fns.
00184  *
00185  * Revision 1.15  2004/02/06 16:01:34  mju
00186  * Use GRE_FIND_FLAGS.
00187  *
00188  * Revision 1.14  2004/02/05 22:08:25  mju
00189  * Integrate datatip support.
00190  *
00191  * Revision 1.13  2003/12/22 16:31:11  vdronov
00192  * made CanViewIn... methods not inline.
00193  *
00194  * Revision 1.12  2003/12/15 16:52:51  mju
00195  * Add dispflag_VectNoFillHighlighted.
00196  *
00197  * Revision 1.11  2003/11/20 13:26:33  mju
00198  * Add SetVisiblityGroupFromLayout.
00199  *
00200  * Revision 1.7  2003/09/23 13:08:08  mju
00201  * Explicitly init serializble in copy dispparm copy ctor.
00202  *
00203  * Revision 1.4  2003/07/31 13:38:40  mju
00204  * Add Filter method to LAYER::FILTER.
00205  *
00206  * Revision 1.3  2003/07/30 15:15:58  mju
00207  * Ignore private sections.
00208  * Move DISPPARM defn outside layer so will be doc'd.  Add inlines where req'd.
00209  *
00210  * Revision 1.2  2003/06/17 13:39:52  mju
00211  * Include mfctreeview.h for MFC.
00212  *
00213  * Revision 1.1  2003/06/16 19:39:43  mju
00214  * Initial revision
00215  * \endif
00216 **/
00217 
00218 #ifndef  INC_GRE_LAYER_H
00219 #define  INC_GRE_LAYER_H
00220 
00221 #ifndef  INC_GRE_OBJECTBASE_H
00222    #include <gre/objectbase.h>
00223 #endif
00224 
00225 #ifndef  INC_GRE_VIEWABLE_H
00226    #include <gre/viewable.h>
00227 #endif
00228 
00229 #ifndef  INC_GRE_3DWIREFRAME_H
00230    #include <gre/3dwireframe.h>
00231 #endif
00232 
00233 #if !defined(INC_GRE_MFCTREEVIEW) && defined(WIN32_MFC)
00234    #include <gre/mfctreeview.h>
00235 #endif
00236 
00237 #if !defined(INC_MI32_GRTREE_H)
00238    #include <mi32/grtree.h>
00239 #endif
00240 
00241 #ifndef  INC_MI32_RANGE_H
00242    #include <mi32/range.h>
00243 #endif
00244 
00245 #ifndef  INC_RVC_ELEMENT_H
00246    #include <rvc/element.h>
00247 #endif
00248 
00249 #ifndef  INC_MI32_RVCPARMS_H
00250    #include <mi32/rvcparms.h>
00251 #endif
00252 
00253 #ifndef  INC_MI32_DBEDIT_H
00254    #include <mi32/dbedit.h>
00255 #endif
00256 
00257 #ifndef  INC_MI32_REGION2D_H
00258    #include <mi32/region2d.h>
00259 #endif
00260 
00261 #ifndef  INC_MI32_TRANS2DC_H
00262    #include <mi32/trans2dc.h>
00263 #endif
00264 
00265 class BITSET;
00266 class BITSET_UNOWNED;
00267 struct SMLCONTEXT;
00268 struct SMLCLASSMEMBER;
00269 union SMLARG;
00270 struct DATATIPPARMS;
00271 namespace RVC {
00272    class GETOBJFILTER;
00273    }
00274 namespace MGD {
00275    class DEVICE;
00276    }
00277 
00278 //===================================================================================================================
00279 
00280 //! Flags stored in xxxxDISPPARM.dispflags
00281 enum DISPFLAGS {
00282    DISPFLAG_None =                  0x00000000,
00283    DISPFLAG_SaveDrawnSetOBS =       0x00000001, //!< OBSOLETE, DO NOT USE, retain def so can read old dispparms
00284    DISPFLAG_KeepOpenOBS =           0x00000002, //!< OBSOLETE, DO NOT USE, retain so can read old dispparms
00285    DISPFLAG_UseTempFile =           0x00000004, //!< Object is in a temporary file
00286    DISPFLAG_EditObjectOBS =         0x00000008, //!< OBSOLETE, DO NOT USE, retain so can read old dispparms
00287    DISPFLAG_NoDrawLabels =          0x40000000, //!< Don't draw labels
00288    DISPFLAG_DrawLabelsOnly =        0x80000000, //!< Only draw labels
00289 
00290    DISPFLAG_WarpToGeorefModel =     0x00000100, //!< Warp to model specified with georeference
00291    DISPFLAG_UsesTransparency =      0x00000200, //!< Uses transparency effects
00292    DISPFLAG_NoDrawWireframe =       0x00000400, //!< Don't draw layer in wireframe mode
00293    DISPFLAG_MayUseTransparency =    0x00000800, //!< Use of transparency unknown, assume it does until first time draw
00294    DISPFLAG_Antialias =             0x00001000, //!< Draw Antialiased
00295    DISPFLAG_HintThinLines =         0x00002000, //!< Imply thin lines via transparency
00296    DISPFLAG_EnableMultiPassRender = 0x00004000, //!< Enable multipass rendering for styles
00297    DISPFLAG_NoMergeLegendDups =     0x00008000, //!< Don't combine duplicate styles in legend
00298 
00299    DISPFLAG_VectDrawNodes =         0x00010000, //!< Draw nodes for vector object
00300    DISPFLAG_VectLinesFirst =        0x00020000, //!< Draw vector lines before polygons
00301    DISPFLAG_VectNoFillPoly =        0x00040000, //!< Disable polygon filling
00302    DISPFLAG_VectNoFillHighlighted = 0x00080000, //!< Disable polygon filling when highlighted
00303 
00304    DISPFLAG_TINEdgesFirst =         0x00020000, //!< Draw TIN edges before triangles
00305    DISPFLAG_TINNoFillTri =          0x00040000, //!< Don't fill TIN triangles
00306 
00307    DISPFLAG_RastNullTransp =        0x00010000, //!< Make "null" cells transparent
00308    DISPFLAG_RastSkipOddLines =      0x00020000, //!< Skip odd screen lines (for 3Dmax glasses)
00309    DISPFLAG_RastSkipEvenLines =     0x00040000, //!< Skip even screen lines (for 3Dmax glasses)
00310    DISPFLAG_RastDoBlendMask =       0x00080000, //!< Do mask transparency blending if possible
00311    DISPFLAG_RastHyperspectLossy =   0x00400000, //!< Display hyperspectral in fast-lossy mode
00312 
00313    DISPFLAG_SurfProjOffEdge =       0x00010000, //!< Project data off edge of surface
00314 
00315    DISPFLAG_FormulaNullTransp =     0x00010000, //!< Make "null" cells transparent
00316    DISPFLAG_FormulaSkipOddLines =   0x00020000, //!< Skip odd screen lines (for 3Dmax glasses)
00317    DISPFLAG_FormulaSkipEvenLines =  0x00040000, //!< Skip even screen lines (for 3Dmax glasses)
00318    };
00319 DEFINE_ENUM_OP_BITWISE(DISPFLAGS);
00320 
00321 //===================================================================================================================
00322 
00323 enum LAYERDRAWFLAGS {
00324    LAYERDRAWFLAG_None =             0x0000,  //!< No flags
00325 // LAYERDRAWFLAG_ClipTo =           0x0001,
00326    LAYERDRAWFLAG_Clip =             0x0002,  //!< Clip layer
00327    LAYERDRAWFLAG_NoClipToGroup =    0x0004,  //!< Don't clip layer to group
00328    LAYERDRAWFLAG_SaveToTemplate =   0x0008,  //!< Save layer as-is to template
00329    LAYERDRAWFLAG_EditInTNTserver =  0x0010,  //!< Allow layer to be edited in TNTserver
00330    LAYERDRAWFLAG_MaskAll =          0xFFFF,  //!< Mask for setting all flags
00331    };
00332 DEFINE_ENUM_OP_BITWISE(LAYERDRAWFLAGS);
00333 
00334 //===================================================================================================================
00335 
00336 enum LAYERFLAGS {
00337    LAYERFLAG_None =                    0x00000000, //!< No flags
00338    LAYERFLAG_NoSelNewObj =             0x00000010, //!< Don't allow user to select new object(s) via CtrlPanel
00339    LAYERFLAG_HiliteColorSet =          0x00000040, //!< Separate highlight color has been set for layer
00340    LAYERFLAG_DataTipIgnoreDrawnSet =   0x00000080, //!< Ignore DrawnSet when searching for DataTip element
00341    LAYERFLAG_3D =                      0x00000200, //!< Layer is fully 3-D, no "surface" required
00342    LAYERFLAG_KeepOpen =                0x00020000, //!< Set if object should remain open until layer is destroyed
00343    LAYERFLAG_Editable =                0x00040000, //!< Set if layer can be edited
00344    LAYERFLAG_CanShowInLocator =        0x00100000, //!< Set if can show this layer in the Locator window
00345    LAYERFLAG_IgnoreExtents =           0x00400000, //!< Ignore this layer when determining group extents
00346    LAYERFLAG_NoGeoreference =          0x00080000, //!< Set if no georeference info should be read for layer
00347    LAYERFLAG_NoDrawActiveElem =        0x01000000, //!< Don't draw "active" element
00348    LAYERFLAG_NoShowInLayerMgr =        0x02000000, //!< Don't show in layer manager, must also set LAYERFLAG_Temporary
00349    LAYERFLAG_NoAllowHide =             0x04000000, //!< Don't allow user to hide layer
00350    LAYERFLAG_NoAllowDelete =           0x08000000, //!< Don't allow user to delete layer
00351    LAYERFLAG_Temporary =               0x10000000, //!< Layer is temporary, cannot save in layout
00352    LAYERFLAG_MaskAll =                 0xFFFFFFFF, //!< Mask for setting all flags
00353    };
00354 DEFINE_ENUM_OP_BITWISE(LAYERFLAGS);
00355 
00356 //===================================================================================================================
00357 
00358 #define  GRE_MAXLAYERTYPES    32
00359 
00360 //! Layer base class.
00361 class GRE_LAYER : public GRE_OBJECT {
00362    public:
00363 
00364       //! Layer types.
00365       enum TYPE {
00366          TYPE_None =       0,
00367          TYPE_Raster =     1,
00368          TYPE_Vector =     2,
00369          TYPE_CAD =        3,
00370          TYPE_DBPinmap =   4,
00371          TYPE_MapGrid =    5,
00372          TYPE_ScaleBar =   6,
00373          TYPE_Text =       7,
00374          TYPE_Legend =     8,
00375          TYPE_TIN =        9,
00376          TYPE_Sketch =     10,
00377          TYPE_Region =     11,
00378          TYPE_Surface =    12,
00379          TYPE_Script =     13,
00380          TYPE_Formula =    14,
00381          TYPE_Legend2 =    15,
00382          TYPE_Shape =      16,
00383          TYPE_NEXT
00384          //! Check GRE_MAXLAYERTYPES when add new types
00385          };
00386 
00387       enum CREATEFLAGS {
00388          CREATEFLAG_None =             0x0000,
00389          CREATEFLAG_NoCallCreateCB =   0x0001,
00390          CREATEFLAG_Temporary =        0x0002,
00391          CREATEFLAG_NoSelNewObj =      0x0004,  //!< Don't allow user to select new object(s) via CtrlPanel
00392          CREATEFLAG_KeepOpen =         0x0008,  //!< Set if object should remain open until layer is destroyed
00393          CREATEFLAG_Editable =         0x0010,  //!< Set if creating layer to be edited
00394          CREATEFLAG_NoGeoreference =   0x0020,  //!< Set if no georeference info should be read for layer
00395          CREATEFLAG_IgnoreExtents =    0x0040,  //!< Ignore layer extents in group
00396          CREATEFLAG_NoAllowDelete =    0x0080,  //!< Don't allow user to delete layer
00397          CREATEFLAG_NoControlPanel =   0x0100,  //!< Don't allow control panel for layer
00398          CREATEFLAG_NoComputePos =     0x0200,  //!< Don't call ComputeLayerPositions() when adding new layer
00399          CREATEFLAG_NoSetActive =      0x0400,  //!< Don't make newly-created layer "active"
00400          CREATEFLAG_NoShowInMgr =      0x0800,  //!< Don't show this layer in layer manager
00401          };
00402 
00403       enum SETACTIVEFLAGS {
00404          SETACTIVEFLAG_None =          0x0000,
00405          SETACTIVEFLAG_First =         0x0001,
00406          SETACTIVEFLAG_Previous =      0x0002,
00407          SETACTIVEFLAG_Next =          0x0004,
00408          SETACTIVEFLAG_Last =          0x0008,
00409          SETACTIVEFLAG_KeepCurrent =   0x0010,  //!< Keep current active element if highlighted
00410          SETACTIVEFLAG_NoWrap =        0x0020,  //!< Don't wrap around end/beginning if reached
00411          SETACTIVEFLAG_UpdateScreen =  0x0040,  //!< Update display window
00412          SETACTIVEFLAG_UpdateBuffers = 0x0080,  //!< Update rendering buffer
00413          };
00414 
00415 
00416       //! Container for global layer options.
00417       class GLOBALOPTIONS {      // GRE_LAYER::GLOBALOPTIONS
00418          public:
00419 
00420             class FORM;                         //!< Global options form, defined in <gre/uilrglob.h>
00421 
00422             enum DFTNAMEMODE {
00423                DFTNAMEMODE_ObjectDesc =      0,    //!< Use object description (or name if no description)
00424                DFTNAMEMODE_ObjectName =      1,    //!< Use object name
00425                DFTNAMEMODE_FileObjNames =    2     //!< Use combined file and object names
00426                };
00427 
00428             GLOBALOPTIONS (
00429                ): m_DftNameMode(DFTNAMEMODE_ObjectDesc), m_AutoOpenDftTableOnSel(true) { }
00430 
00431          #ifdef X_NATIVE
00432             Widget CreateEditForm (
00433                Widget parent,
00434                const Arg *arglist,
00435                int argcount
00436                );
00437          #endif
00438 
00439             bool GetAutoOpenDftTableOnSel (
00440                ) const { return (m_AutoOpenDftTableOnSel); }
00441 
00442             DFTNAMEMODE GetDftNameMode (
00443                ) const { return (m_DftNameMode); }
00444 
00445             void IniRead (
00446                const char *inigroup = 0
00447                );
00448 
00449             void IniWrite (
00450                const char *inigroup = 0
00451                ) const;
00452 
00453             void SetAutoOpenDftTableOnSel (
00454                bool AutoOpenDftTableOnSel
00455                ) { m_AutoOpenDftTableOnSel = AutoOpenDftTableOnSel; }
00456 
00457             void SetDftNameMode (
00458                DFTNAMEMODE DftNameMode
00459                ) { m_DftNameMode = DftNameMode; }
00460                
00461             void SetAntialiasing (
00462                bool antialias
00463                ) { m_Antialiasing = antialias; }
00464 
00465             void SetHintThinLines (
00466                bool hint
00467                ){ m_HintThinLines = hint;}
00468 
00469             bool GetAntialiasing (
00470                ) const { return (m_Antialiasing); }
00471 
00472             bool GetDftRenderMultiPass (
00473                ) const { return (m_DftRenderMultiPass); }
00474 
00475             bool GetHintThinLines (
00476                ) const { return (m_HintThinLines); }
00477 
00478          private:
00479             #ifndef GENERATING_DOXYGEN_OUTPUT
00480             DFTNAMEMODE m_DftNameMode;
00481             bool m_AutoOpenDftTableOnSel;       //!< Automatically open default table on element selection (highlighting)
00482             friend class GRE_LAYER;
00483             bool m_Antialiasing;
00484             bool m_HintThinLines;
00485             bool m_DftRenderMultiPass;
00486 
00487             #endif // GENERATING_DOXYGEN_OUTPUT
00488          }; // End of GRE_LAYER::GLOBALOPTIONS
00489 
00490       class DISPPARM;
00491 
00492       class TYPEDEFN;
00493       class COMPINFO;
00494       class FILTER;
00495       class FILTER_EXCLUDE;
00496 
00497    #ifdef X_NATIVE
00498       //! Form for layer in "object manager".
00499       class OBJMGRFORM {
00500          public:
00501 
00502             //! Constructor.
00503             OBJMGRFORM (
00504                GRE_LAYER *layer
00505                );
00506 
00507             //! Destructor.
00508             ~OBJMGRFORM (
00509                );
00510 
00511             //! Create the form widget.
00512             Widget Create (
00513                );
00514 
00515             void DestroyForm (
00516                );
00517 
00518             Widget GetForm (
00519                ) const { return (m_form); }
00520 
00521             Widget GetToolMenuButton (
00522                ) const { return (m_ToolIconMB); }
00523 
00524             //! Hide the layer form in the object manager.
00525             void Hide (
00526                );
00527 
00528             void HideDetails (
00529                );
00530 
00531             //! Set the position of the object manager
00532             //! @return Next position after item.
00533             short SetObjMgrPos (
00534                short pindex = -2
00535                );
00536 
00537             //! Show layer form in object manager.
00538             short Show (
00539                short pindex = -2
00540                );
00541 
00542             void ShowDetails (
00543                );
00544 
00545          private:
00546             #ifndef GENERATING_DOXYGEN_OUTPUT
00547 
00548             GRE_LAYER *m_layer;
00549             Widget m_form;
00550             Widget m_ActiveTB;
00551             Widget m_ShowDetailsTB;
00552             Widget m_ToolIconMB;
00553             Widget m_VisibleIcon[GRE_MAXVIEWS];
00554             Widget m_MinScaleVisibleP;
00555             Widget m_MaxScaleVisibleP;
00556             Widget m_NameLabel;
00557             Widget m_DeleteMB;
00558 
00559             
00560             static void CB_CmdLayerDelete (Widget, void *vlayer, void*);
00561             static void CB_CmdLayerControls (Widget, void *vlayer, void*);
00562             static void CB_CmdTool (Widget, void *voption, void*);
00563             static void CB_EditScaleRange (Widget, void *vlayer);
00564             static void CB_NotifyGreObject (const GRE_CALLBACK_MSG *msg, void *vpObjMgrForm);
00565             static void CB_NotifyGreView (const GRE_CALLBACK_MSG *msg, void*);
00566             static void CB_ToggleActive (Widget, void *vlayer, XmToggleButtonCallbackStruct*);
00567             static void CB_ToggleShowDetails (Widget, void *vpObjMgrForm, XmToggleButtonCallbackStruct*);
00568             static void CB_ToggleVisibleInViewNum (Widget, void *vViewNum, XmToggleButtonCallbackStruct*);
00569 
00570             void OnNotifyGreObject (const GRE_CALLBACK_MSG& msg);
00571             void UpdateShowInternalTables ();
00572             void UpdateShowScaleRanges ();
00573 
00574             OBJMGRFORM (const OBJMGRFORM&);
00575             OBJMGRFORM& operator= (const OBJMGRFORM&);
00576 
00577             #endif // GENERATING_DOXYGEN_OUTPUT
00578          }; //! End of GRE_LAYER::OBJMGRFORM
00579    #endif
00580 
00581    #ifdef X_NATIVE
00582       class RAWELEMFORM {
00583          public:
00584 
00585             //! Constructor.
00586             explicit RAWELEMFORM (
00587                GRE_LAYER *layer
00588                );
00589 
00590             //! Destructor.
00591             ~RAWELEMFORM (
00592                );
00593 
00594             void CreateToggleForm (
00595                );
00596 
00597             void DestroyForms (
00598                );
00599 
00600             Widget GetToggleForm (
00601                ) const { return (m_ToggleForm); }
00602 
00603             void HideForms (
00604                );
00605 
00606             bool IsInfoShown (
00607                ) const { return (m_InfoForm != 0 && XtIsManaged(m_InfoForm)); }
00608 
00609             void SetElement (
00610                ELEMTYPE ElemType,
00611                INT32 ElemNum
00612                );
00613 
00614             short ShowToggleForm (
00615                short pindex
00616                );
00617 
00618             void SetInfoText (
00619                const MIUNICODE *string
00620                );
00621 
00622             //! Set the position of the Object Manager
00623             //! @return Next position after item.
00624             short SetObjMgrPos (
00625                short pindex
00626                );
00627 
00628          private:
00629             #ifndef GENERATING_DOXYGEN_OUTPUT
00630 
00631             GRE_LAYER *m_layer;
00632             ELEMTYPE m_ElemType;
00633             INT32 m_ElemNum;
00634             Widget m_ToggleForm;             //!< Form containing toggle for showing raw info
00635             Widget m_ShowInfoTB;             //!< Toggle for showing raw info
00636             Widget m_InfoForm;               //!< Form containing raw info
00637             Widget m_ElemNumP;               //!< 'Prompt' for entering element number
00638             Widget m_ElemTypeTB[6];          //!< ToggleButtons for selecting element type, indexed by component
00639             Widget m_InfoXeT;
00640 
00641             static void CB_BtnNextSelected (Widget, void*, void*);
00642             static void CB_BtnPrevSelected (Widget, void*, void*);
00643             static void CB_BtnSelectPrev (Widget, void*, void*);
00644             static void CB_BtnSelectNext (Widget, void*, void*);
00645             static void CB_EditElemNum (Widget, void*);
00646             static void CB_ToggleSetElemType (Widget, void*, void*);
00647             static void CB_ToggleShowInfo (Widget, void*, XmToggleButtonCallbackStruct*);
00648             static void EH_ResizeSW (Widget, void*, XEvent*, Boolean*);
00649 
00650             void CreateInfoForm ();
00651             void OnEditElemNum ();
00652             void SelectPrevNext (int add);
00653             void SetElemType (ELEMTYPE ElemType);
00654             void ShowInfoForm (bool show);
00655 
00656             RAWELEMFORM (const RAWELEMFORM&);
00657             RAWELEMFORM& operator= (const RAWELEMFORM&);
00658 
00659             #endif // GENERATING_DOXYGEN_OUTPUT
00660          }; //! End of GRE_LAYER::RAWELEMFORM
00661    #endif
00662 
00663       //! Determine if can construct layer from RVC object.
00664       static bool CanConstructFromObject (
00665          const RVC::OBJITEM& objitem
00666          );
00667 
00668       //! Compute default maximum visible scale based on object element detail/density.
00669       //! Maximum scale returned, 0 if none.
00670       static double ComputeDftMaxVisibleScale (
00671          const RVC::OBJITEM& objitem            //!< Object to use
00672          );
00673 
00674       //! Construct layer of specified type and assign specified object.
00675       static ERRVALUE ConstructAndAssignObject (
00676          GRE_GROUP *group,                      //!< Group to add layer to
00677          GRE_LAYER::TYPE layertype,             //!< Type of layer to construct
00678          const RVC::OBJITEM& objitem,           //!< Object to assign
00679          GRE_LAYER **retlayer = 0,              //!< Layer returned, NULL if not needed
00680          CREATEFLAGS createflags = GRE_LAYER::CREATEFLAG_None, //!< Layer creation flags
00681          GRE::LISTPOS listpos = GRE::LISTPOS_Last, //!< Position for new layer in list
00682          GRE_LAYER *reflayer = 0                //!< Reference layer for insertion before or after
00683          );
00684 
00685    #ifdef USE_MGUI
00686       //! Construct layer of specified type, prompt for object, and optional open settings window.
00687       static ERRVALUE ConstructAndPromptObject (
00688          MDLGPARENT dlgparent,                  //!< Parent for dialogs
00689          GRE_GROUP *group,                      //!< Group to add layer to
00690          GRE_LAYER::TYPE layertype,             //!< Type of layer to construct
00691          GRE_LAYER **retlayer,                  //!< Layer returned, NULL if not needed
00692          CREATEFLAGS createflags,               //!< Layer creation flags
00693          GRE::LISTPOS listpos,                  //!< Position for new layer in list
00694          GRE_LAYER *reflayer,                   //!< Reference layer for insertion before or after
00695          bool OpenSettings                      //!< true to open settings window
00696          );
00697    #endif
00698 
00699    #ifdef USE_MGUI
00700       //! Construct layers using geospatial catalog.
00701       static ERRVALUE ConstructFromGeoCat (
00702          MDLGPARENT dlgparent,
00703          GRE_GROUP *group
00704          );
00705    #endif
00706 
00707       //! Construct layer from specified object.
00708       static ERRVALUE ConstructFromObject (
00709          GRE_GROUP *group,                         //!< Group to contain new layer
00710          const RVC::OBJITEM& objitem,              //!< Object to construct layer for
00711          GRE_LAYER **retlayer = 0,                 //!< New layer returned
00712          CREATEFLAGS createflags = CREATEFLAG_None,//!< Creation flags
00713          GRE::LISTPOS listpos = GRE::LISTPOS_Last, //!< Position of new layer in list
00714          GRE_LAYER *reflayer = 0,                  //!< Reference layer for insertion
00715          MDLGPARENT dlgparent = 0                  //!< Parent for verification dialogs, NULL to not use
00716          );
00717 
00718       //! Construct multiple layers using object list (quick-add).
00719       static ERRVALUE ConstructFromObjList (
00720          GRE_GROUP *group,                      //!< Group to construct layers in, layers will be added after active layer
00721          const RVC::OBJITEMLIST& objlist,       //!< List of objects to construct layers for
00722          MDLGPARENT dlgparent = 0               //!< Parent for verification dialogs, NULL to not use
00723          );
00724 
00725       //! Edit global settings via dialog
00726       //! @return true if settings changed, false if not
00727       static bool EditGlobalSettings (
00728          MDLGPARENT dlgparent
00729          );
00730 
00731       //! Get default layer naming mode.
00732       static GLOBALOPTIONS::DFTNAMEMODE GetDftNameMode (
00733          ) { return (s_GlobalOptions.m_DftNameMode); }
00734 
00735       //! Get global options applying to all layers.
00736       static const GLOBALOPTIONS& GetGlobalOptions (
00737          ) { InitStatic(); return (s_GlobalOptions); }
00738 
00739       //! Get number of registered layer types
00740       static UINT16 GetNumTypes (
00741          ) { return (s_NumTypes); }
00742 
00743       //! Get type definition for specific layer type index
00744       static const TYPEDEFN& GetTypeDefn (
00745          UINT16 idx
00746          ) { return (*s_TypeDefns[idx]); }
00747 
00748       //! Get type definition for specific layer type
00749       static const TYPEDEFN* GetTypeDefn (
00750          TYPE layertype
00751          );
00752 
00753       //! Get TEXTID for specific layer type name.
00754       static TEXTID GetTypeName (
00755          TYPE layertype
00756          );
00757 
00758       //! Determine if object has high density/detail.
00759       static bool HasDenseDetail (
00760          const RVC::OBJITEM& objitem            //!< Object to check
00761          );
00762 
00763    #if defined(X_NATIVE) || defined(WIN32_MFC)
00764       //! Prompt for multiple objects for quick-add.
00765       static ERRVALUE PromptObjects (
00766          MDLGPARENT dlgparent,                  //!< Parent for dialog
00767          RVC::OBJITEMLIST& objlist,             //!< List of selected objects returned
00768          GETOBJFLAGS flags=GETOBJFLAG_None,     //!< Additional flags for selection dialog
00769          const MIUNICODE *prompt = 0               //!< Prompt message for use in dialog ( Default is TEXTID_Prompt_Objects_Display )
00770          );
00771    #endif
00772 
00773    #if defined(X_NATIVE) || defined(WIN32_MFC)
00774       //! Prompt for multiple objects and construct layers in specified group.
00775       static ERRVALUE PromptObjectsAndConstruct (
00776          MDLGPARENT dlgparent,                  //!< Parent for dialog
00777          GRE_GROUP *group                       //!< Group to add layers to
00778          );
00779    #endif
00780 
00781       //! Register layer type
00782       static void RegisterLayerType (
00783          TYPEDEFN& typedefn
00784          );
00785 
00786       //! Set whether the default attribute table should be opened on element selection.
00787       static void SetAutoOpenDftTableOnSel (
00788          bool AutoOpenDftTableOnSel
00789          ) { s_GlobalOptions.m_AutoOpenDftTableOnSel = AutoOpenDftTableOnSel; }
00790 
00791       //! Set default layer naming mode
00792       static void SetDftNameMode (
00793          GLOBALOPTIONS::DFTNAMEMODE DftNameMode
00794          ) { s_GlobalOptions.m_DftNameMode = DftNameMode; }
00795 
00796       //! Set global options applying to all layers.
00797       static void SetGlobalOptions (
00798          const GLOBALOPTIONS& options
00799          ) { s_GlobalOptions = options; }
00800 
00801       //! Method to install SML class, called by internal SML function.
00802       static void SMLClassInstall (
00803          SMLCONTEXT *context                    //!< SML context
00804          );
00805 
00806       static SMLCLASSMEMBER* GetSMLClassMembers (
00807          );
00808 
00809       //! Constructor.
00810       GRE_LAYER (
00811          GRE_GROUP *group,                         //!< Group to contain layer
00812          TYPE layertype,                           //!< Layer type
00813          DISPPARM& dispparm,                       //!< Reference to layer's internal DISPPARM
00814          CREATEFLAGS createflags,                  //!< Creation flags
00815          GRE::LISTPOS listpos = GRE::LISTPOS_Last, //!< Position in list
00816          GRE_LAYER *reflayer = 0                   //!< Reference layer for insertion
00817          );
00818 
00819       //! Destructor
00820       virtual ~GRE_LAYER ();
00821 
00822    #ifdef WIN32_MFC
00823       //! Add "details" items to treeview (WIN32_MFC).
00824       void AddTreeViewDetails (
00825          GRE_MFC_TREEVIEW& TreeView,
00826          HTREEITEM hParent,
00827          HTREEITEM hInsertAfter
00828          ) { v_AddTreeViewDetails(TreeView,hParent,hInsertAfter); }
00829    #endif
00830 
00831    #ifdef WIN32_MFC
00832       //! Add "legend" items to treeview (WIN32_MFC).
00833       void AddTreeViewLegend (
00834          GRE_MFC_TREEVIEW& TreeView,
00835          HTREEITEM hParent,
00836          HTREEITEM hInsertAfter
00837          ) { v_AddTreeViewLegend(TreeView,hParent,hInsertAfter); }
00838    #endif
00839 
00840    #ifdef X_NATIVE
00841       //! Append items to popup menu (X only).
00842       void AppendPopupMenuItems (
00843          Widget widget,                      //!< Widget popup event occurred in
00844          const DPOINT2D *point,              //!< Point in layer coordinates where popup event occurred, NULL if not in view
00845          MENUITEMARRAY& menuitems            //!< Menu item array to append to
00846          ) { v_AppendPopupMenuItems(widget,point,menuitems); }
00847    #endif
00848 
00849       //! Assign layer to use specified object.
00850       ERRVALUE AssignObject (
00851          const RVC::OBJITEM& objitem,           //!< Object to assign
00852          MDLGPARENT dlgparent = 0               //!< Parent for verification/setting dialogs, NULL to not use such dialogs
00853          ) { return (v_AssignObject(objitem,dlgparent)); }
00854 
00855    #ifndef NO_DEPRECATED
00856       //! Assign layer to use specified object.
00857       //! \deprecated Use variant with RVC::OBJITEM.
00858       DEPRECATED ERRVALUE AssignObject (
00859          const FNAMEINODEUC *fnip
00860          );
00861    #endif
00862 
00863       //! Determine if layer is set to be editable via TNTserver.
00864       bool CanEditInTNTserver (
00865          ) const { return ((drawflags & LAYERDRAWFLAG_EditInTNTserver) != 0); }
00866 
00867       //! Determine if capable of retrieving element extents
00868       bool CanGetElemExtents (
00869          ) const { return (m_CanGetElemExtents); }
00870 
00871       //! Determine if can open control dialog for layer
00872       bool CanOpenControlPanel (
00873          ) const { return (!m_IsControlPanelDisabled); }
00874 
00875       //! Determine if capable of reporting raw element information
00876       bool CanReportRawElemInfo (
00877          ) const { return (m_CanReportRawElemInfo); }
00878 
00879       //! Determine if can show "details" (components).
00880       bool CanShowDetails (
00881          ) const { return (v_CanShowDetails()); }
00882 
00883       //! Determine if element can be tested if inside/outside region
00884       bool CanTestElementByRegion (
00885          ) const { return (m_CanTestElementByRegion); }
00886 
00887       //! Determine if layer can be viewed in 2D.
00888       bool CanViewIn2D (
00889          );
00890 
00891       //! Determine if layer can be viewed in 3D.
00892       bool CanViewIn3D (
00893          );
00894 
00895       //! Change position in list
00896       bool ChangeListPos (
00897          GRE_LAYER* reflayer,                   //!< Reference layer for LISTPOS_Before and LISTPOS_After
00898          GRE::LISTPOS listpos                   //!< New position in list
00899          );
00900 
00901       //! Check for high feature density/detail and let user set visibility options if exceeds threshold.
00902       ERRVALUE CheckDenseDetail (
00903          MDLGPARENT dlgparent                   //!< Parent for dialog
00904          );
00905 
00906       //! Request close of object(s) associated with layer.
00907       void CloseObject (
00908          ) { v_CloseObject(); };
00909 
00910       //! Compute "margins" for layer
00911       void ComputeMargins (
00912          double& tmargin,                       //!< Top margin in "layer" coordinates returned
00913          double& bmargin,                       //!< Bottom margin in "layer" coordinates returned
00914          double& lmargin,                       //!< Left margin in "layer" coordinates returned
00915          double& rmargin                        //!< Right margin in "layer" coordinates returned
00916          ) { v_ComputeMargins(tmargin,bmargin,lmargin,rmargin); }
00917 
00918    #ifndef GENERATING_DOXYGEN_OUTPUT
00919       // Construct LAYERVIEW instance for this layer and specified view.
00920       GRE::LAYERVIEW* ConstructLayerView (
00921          GRE_VIEW *view
00922          ) { return (v_ConstructLayerView(view)); }
00923    #endif
00924    
00925       //! Make a copy of 'this' given a parent group to belong to.
00926       GRE_LAYER* Copy (
00927          GRE_GROUP* NewGroup
00928          ) const { return (v_Copy(NewGroup)); }
00929 
00930       //! Get default DataTip prefix for specified component.
00931       void DataTipGetDefaultPrefix (
00932          int component,                         //!< Component index
00933          DATATIPPARMS& DataTipParms             //!< DataTip parameters passed/returned
00934          ) const { v_DataTipGetDefaultPrefix(component,DataTipParms); }
00935 
00936       //! Get DataTip settings for specified component
00937       const DATATIPPARMS& DataTipGetParms (
00938          int component                          //!< Component index
00939          ) const { return (v_DataTipGetParms(component)); }
00940 
00941       //! Get DataTip search distance in pixels.
00942       inline int DataTipGetSearchDist (
00943          ) const;
00944 
00945       //! Get DataTip text for specified element.
00946       //! @return TRUE if have DataTip, FALSE if not, < 0 if error.
00947       int DataTipGetString (
00948          ELEMTYPE ElemType,                     //!< Element type
00949          INT32 ElemNum,                         //!< Element number
00950          MISTRING& string                       //!< String to contain result
00951          ) { return (v_DataTipGetString(ElemType,ElemNum,string)); }
00952 
00953       //! Get DataTip text for specified point.
00954       //! If a view is specified and the layer is visible in that view then only
00955       //! visible elements will be searched.
00956       //! @return TRUE if have string, FALSE if not, < 0 if error
00957       int DataTipGetString (
00958          const DPOINT2D& point,                 //!< Point in layer coordinates
00959          MISTRING& string,                      //!< String to contain result
00960          GRE_VIEW *view = 0                     //!< Optional view to determine whether to limit to 'visible' elements
00961          ) { return (v_DataTipGetString(point,string,view)); }
00962 
00963       //! Determine if has DataTip available for any component.
00964       bool DataTipHasAvailable (
00965          ) const;
00966 
00967       //! Determine if has DataTip enabled for any component.
00968       bool DataTipHasEnabled (
00969          ) const;
00970 
00971       //! Determine if DataTip is enabled for this layer.
00972       //! May also need to use DataTipHasAvailable to determine if a DataTip is actually available.
00973       bool DataTipIsEnabled (
00974          ) const { return (m_DataTipEnabled); }
00975 
00976       //! Set default DataTip prefix for specified layer component.
00977       void DataTipSetDefaultPrefix (
00978          int component                          //!< Component index
00979          );
00980 
00981       //! Set DataTip parameters for specified layer component
00982       ERRVALUE DataTipSetParms (
00983          int component,                         //!< Component index
00984          const DATATIPPARMS& DataTipParms       //!< Parameter values to set
00985          ) { return (v_DataTipSetParms(component,DataTipParms)); }
00986 
00987       //! Translate DbList index to element number.
00988       INT32 DbListIndexToElemNum (
00989          int component,
00990          INT32 index
00991          ) { return (v_DbListIndexToElemNum(component,index)); }
00992 
00993       //! Translate element number to DbList index.
00994       INT32 DbListElemNumToIndex (
00995          int component,
00996          INT32 ElemNum
00997          ) { return (v_DbListElemNumToIndex(component,ElemNum)); }
00998 
00999       //! Determine if DbList index is same as element number.
01000       bool DbListIsIndexElemNum (
01001          ) const { return (m_DbListIsIndexElemNum); }
01002 
01003       //! Destroy all LAYERVIEW instances associated with this layer.
01004       void DestroyAllLayerViews (
01005          );
01006 
01007       //! Disable access to layer controls.
01008       void DisableControlPanel (
01009          ) { m_IsControlPanelDisabled = true; }
01010 
01011       //! Draw this layer.
01012       ERRVALUE Draw (
01013          GRE_LAYERDC& layerdc                   //!< Drawing control parameters
01014          ) { return (v_Draw(layerdc)); }
01015 
01016       //! Draw all views containing layer.
01017       ERRVALUE DrawAllViews (
01018          GRE::DRAWCONDITION condition = GRE::DRAWCONDITION_Always
01019          );
01020 
01021       //! Draw single element given ELEMTYPE and element number.
01022       ERRVALUE DrawElement (
01023          GRE_VIEW *view,                        //!< View to draw in, 0 for all
01024          ELEMTYPE ElemType,                     //!< Element type
01025          INT32 ElemNum,                         //!< Element number
01026          GRE::RENDERTARGET Target,              //!< Target buffer(s) to render to
01027          GRE::DRAWFLAGS drawflags = GRE::DRAWFLAG_None   //!< Drawing flags
01028          );
01029 
01030       //! Draw single element given RVC::ELEMENT.
01031       ERRVALUE DrawElement (
01032          GRE_VIEW *view,                        //!< View to draw in, 0 for all
01033          const RVC::ELEMENT& element,           //!< Element specifier
01034          GRE::RENDERTARGET Target,              //!< Target buffer(s) to render to
01035          GRE::DRAWFLAGS drawflags = GRE::DRAWFLAG_None   //!< Drawing flags
01036          ) { return (DrawElement(view,element.GetType(),element.GetNumber(),Target,drawflags)); }
01037 
01038       //! Draw single element for this layer
01039       ERRVALUE DrawElementLow (
01040          GRE_LAYERDC& layerdc,                  //!< Drawing control parameters
01041          ELEMTYPE ElemType,                     //!< Element type
01042          INT32 ElemNum,                         //!< Element number
01043          const void *style                      //!< Style for override, 0 for default
01044          ) { return (v_DrawElementLow(layerdc,ElemType,ElemNum,style)); }
01045 
01046       //! Draw multiple elements specified by bit set.
01047       ERRVALUE DrawElements (
01048          GRE_VIEW *view,                        //!< View to draw in, 0 for all
01049          ELEMTYPE ElemType,                     //!< Element type
01050          UINT8 *ElemSet,                        //!< Bit set of elements to draw
01051          GRE::RENDERTARGET Target,              //!< Target buffer(s) to render to
01052          GRE::DRAWFLAGS drawflags = GRE::DRAWFLAG_None   //!< Drawing flags
01053          );
01054 
01055       //! Draw set of elements for this layer
01056       ERRVALUE DrawElementsLow (
01057          GRE_LAYERDC& layerdc,                  //!< Drawing control parameters
01058          ELEMTYPE ElemType,                     //!< Element type
01059          const UINT8 *ElemSet,                  //!< Element set
01060          const void *style                      //!< Style for override, 0 for default
01061          ) { return (v_DrawElementsLow(layerdc,ElemType,ElemSet,style)); }
01062 
01063       //! Draw element sample.
01064       ERRVALUE DrawElementSample (
01065          const GRE_ELEMSAMPLE_DC& sampledc,     //!< Drawing control parameters
01066          const RVC::ELEMENT& element,           //!< Element
01067          const LRECT2D& samplerect              //!< Destination rectangle
01068          ) { return (v_DrawElementSample(sampledc,element,samplerect)); }
01069 
01070       //! Draw highlighted elements.
01071       ERRVALUE DrawHighlighted (
01072          GRE_VIEW *view,                        //!< View to draw in, 0 for all
01073          GRE::DRAWFLAGS DrawFlags = GRE::DRAWFLAG_None
01074          );
01075 
01076       //! Draw a single label for this layer
01077       ERRVALUE DrawLabel (
01078          GRE_LAYERDC& layerdc,                  //!< Drawing control parameters
01079          const GRE::LABELPLACE& place,
01080          const COLOR* ForegroundColor = 0       //!< Overrides foreground color if not NULL
01081          );
01082 
01083       //! Draw set of labels for this layer
01084       ERRVALUE DrawLabels (
01085          GRE_LAYERDC& layerdc                //!< Drawing control parameters
01086          );
01087 
01088       //! Display dialog to select highlighting colors.
01089       void EditColors (
01090          MDLGPARENT dlgparent                   //!< Parent for dialog
01091          );
01092 
01093       //! Enable DataTip for layer if available.
01094       //! The DataTip is enabled by default, this setting allows the user to easily turn DataTips on/off by layer.
01095       void EnableDataTip (
01096          bool enable = true
01097          ) { m_DataTipEnabled = enable; return; }
01098 
01099       //! Find closest element to specified point.
01100       //! @return element number, -1 if not found, < -1 if error
01101       INT32 FindClosestElement (
01102          const DPOINT2D& point,                 //!< Point in "object" coordinates
01103          double searchdist,                     //!< Distance to search in "object" coordinates
01104          double *distret,                       //!< Distance returned in "object" coordinates, (NULL if don't need)
01105          int component,                         //!< Component to search
01106          const UINT8 *SearchSet,                //!< Set of elements to search, NULL for all elements
01107          GRE_FIND_FLAGS findflags               //!< GRE_FIND_... flags
01108          ) { return (v_FindClosestElement(point,searchdist,distret,component,SearchSet,findflags)); }
01109 
01110       //! Find elements matching specified query.
01111       //! @return number of elements found, < 0 if error
01112       INT32 FindElementsByQuery (
01113          ELEMTYPE ElemType,                     //!< Element type
01114          BITSET_UNOWNED& ElemSet,               //!< Set of elements found
01115          const MIUNICODE *QueryScript,          //!< Query script string
01116          SMLCONTEXT* QueryContext = 0           //!< Query/SML context
01117          );
01118 
01119       //! Find elements matching specified query with "match quality".
01120       //! An array of values, one per element, is returned with values from 0-255 corresponding
01121       //! to query return values from 0.0 to 1.0.  Values < 0 will be 0, values > 255 will be 255.
01122       ERRVALUE FindElementsByQueryExt (
01123          ELEMTYPE ElemType,                     //!< Element type
01124          SIMPLE_ARRAY<UINT8>& Result,           //!< Result for each element
01125          const MIUNICODE *QueryScript,          //!< Query script string
01126          SMLCONTEXT* QueryContext = 0           //!< Query/SML context
01127          );
01128 
01129       //! Find surface layer for draping this layer onto in 3D.
01130       //! @return Pointer to surface layer or NULL if none.
01131       GRE_LAYER_SURFACE* FindSurfaceLayer (
01132          ) const;
01133 
01134    #ifndef GENERATING_DOXYGEN_OUTPUT
01135       // Make protected when possible.
01136       void FinishCreation (
01137          bool notify = true                     //!< Send creation notification
01138          );
01139 
01140    #endif // GENERATING_DOXYGEN_OUTPUT
01141 
01142       //! Get active element type and number.
01143       //! @return 'true' if have active element, false if not.
01144       inline bool GetActiveElement (
01145          ELEMTYPE& ElemType,                    //!< Element type returned
01146          INT32& ElemNum                         //!< Element number returned
01147          ) const;
01148 
01149       //! Get active element as RVC::ELEMENT.
01150       //! @return 'true' if have active element, false if not.
01151       inline bool GetActiveElement (
01152          RVC::ELEMENT& element                  //!< Element specifier returned
01153          ) const;
01154 
01155       //! Get active element number.
01156       //! @return Element number or -1 if no active element.
01157       inline INT32 GetActiveElemNum (
01158          ) const;
01159 
01160       //! Get active element type.
01161       //! @return Element type, ELEMTYPE_Empty if no active element.
01162       inline ELEMTYPE GetActiveElemType (
01163          ) const;
01164 
01165       //! Get color for 3D pedestal.
01166       inline const COLOR& GetColorPedestal (
01167          ) const;
01168 
01169       //! Get component for specified element type.
01170       //! @return Component index, -1 if no corresponding component.
01171       int GetComponent (
01172          ELEMTYPE ElemType                      //!< Element type
01173          ) const { return (v_GetComponent(ElemType)); }
01174 
01175       //! Get icon for component.
01176       //! @return Icon for component or NULL if none
01177       MICON GetComponentIcon (
01178          int component                          //!< Component index
01179          ) const { return (v_GetComponentIcon(component)); }
01180 
01181       //! Get component information.
01182       //! @return Pointer to component information or NULL if none.
01183       COMPINFO* GetComponentInfo (
01184          int component                          //!< Component index
01185          ) { return (v_GetComponentInfo(component)); }
01186 
01187       //! Get component information (const version).
01188       //! @return Pointer to component information or NULL if none.
01189       const COMPINFO* GetComponentInfo (
01190          int component
01191          ) const { return (const_cast<GRE_LAYER*>(this)->GetComponentInfo(component)); }
01192 
01193       //! Get component information by element type.
01194       //! @return Pointer to component information or NULL if none.
01195       COMPINFO* GetComponentInfoByType (
01196          ELEMTYPE elemtype                      //!< Element type
01197          );
01198 
01199       //! Get localized name of component.
01200       //! @return Component name.
01201       MISTRING GetComponentName (
01202          int component                          //!< Component index
01203          ) const { return (v_GetComponentName(component)); }
01204 
01205       //! Get "parent" for dialogs associated with layer.
01206       MDLGPARENT GetDialogParent (
01207          ) const;
01208 
01209       //! Get DISPFLAGS for layer.
01210       inline DISPFLAGS GetDispFlags (
01211          ) const;
01212 
01213       UINT16 GetDispParmUsage (
01214          ) const { return ((layerflags & LAYERFLAG_Editable) ? DPARMUSAGE_Edit : DPARMUSAGE_Display); }
01215 
01216       //! Get pointer to default style of element type.
01217       //! @return Pointer to style, do not free.
01218       const void* GetElemDefaultStyle (
01219          ELEMTYPE ElemType                      //!< Element type
01220          ) const { return (v_GetElemDefaultStyle(ElemType)); }
01221 
01222       //! Get selection mode for element drawing
01223       //! @return Selection mode
01224       UINT16 GetElemDrawSelectionMode (
01225          ELEMTYPE ElemType                      //!< Element type
01226          ) const { return (v_GetElemDrawSelectionMode(ElemType)); }
01227 
01228       //! Get style mode for element drawing.
01229       //! @return style mode
01230       UINT16 GetElemDrawStyleMode (
01231          ELEMTYPE ElemType                      //!< Element type
01232          ) const { return (v_GetElemDrawStyleMode(ElemType)); }
01233 
01234       //! Get extents of specified element.
01235       ERRVALUE GetElemExtents (
01236          ELEMTYPE ElemType,                     //!< Element type
01237          INT32 ElemNum,                         //!< Element number
01238          DRECT3D& Extents                       //!< Extents returned
012