gre/group.h

Go to the documentation of this file.
00001 /**
00002  * \file group.h <gre/group.h>
00003  * \brief GRE::GROUP class definitions
00004  *
00005  * \if NODOC
00006  * $Id: group.h_v 1.48 2006/06/07 12:38:40 mju Exp $
00007  *
00008  * $Log: group.h_v $
00009  * Revision 1.48  2006/06/07 12:38:40  mju
00010  * Add createflag_sml and groupflags_CreatedBySML.
00011  *
00012  * Revision 1.47  2006/05/16 16:20:54  mju
00013  * Remove getRenderCRS as just use getUsedCRS.
00014  *
00015  * Revision 1.46  2006/05/05 13:48:04  mju
00016  * Support deferred creation.
00017  *
00018  * Revision 1.45  2005/11/28 18:53:26  mju
00019  * Add v_getMax/MinScaleVisibleAny.
00020  *
00021  * Revision 1.44  2005/11/11 22:51:40  mju
00022  * Use mistring for reflayername.
00023  *
00024  * Revision 1.43  2005/11/04 18:51:51  mju
00025  * enums in gre namespace.
00026  *
00027  * Revision 1.42  2005/11/02 23:00:40  mju
00028  * Remove objmgr stuff.
00029  *
00030  * Revision 1.41  2005/10/19 20:04:50  mju
00031  * Use gre namespace instead of legacy typedefs.
00032  *
00033  * Revision 1.40  2005/10/19 17:25:53  mju
00034  * Remove unneeded typedef.
00035  *
00036  * Revision 1.39  2005/10/14 17:30:09  mju
00037  * GRE namespace.
00038  *
00039  * Revision 1.38  2005/06/30 16:49:19  mju
00040  * Add mask for groupflag to determine which flags don't require redraw.
00041  *
00042  * Revision 1.37  2005/06/14 15:27:28  mju
00043  * Add parm to getMatchedGroup to determine if want first in link.
00044  *
00045  * Revision 1.36  2005/06/10 20:34:59  vdronov
00046  * combined old and new 3d rendering
00047  *
00048  * Revision 1.35  2005/05/31 15:20:00  mju
00049  * Make getUsedCoordRefSys non-inline.
00050  *
00051  * Revision 1.34  2005/05/31 13:45:12  mju
00052  * Add getNeedUpdateExtents.
00053  *
00054  * Revision 1.33  2005/05/13 14:37:25  scowan
00055  * Moved global standalone group list to system.
00056  *
00057  * Revision 1.32  2005/05/02 17:43:36  mju
00058  * Move highightMode to viewable.
00059  *
00060  * Revision 1.31  2005/04/29 17:49:45  mju
00061  * Support rendertarget.
00062  *
00063  * Revision 1.30  2005/03/31 16:57:05  fileserver!dwilliss
00064  * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define
00065  *
00066  * Revision 1.29  2005/03/22 22:00:55  mju
00067  * Add invalidateAllViews.
00068  *
00069  * Revision 1.28  2005/03/16 23:56:35  vdronov
00070  * *** empty log message ***
00071  *
00072  * Revision 1.27  2005/03/16 22:37:55  vdronov
00073  * added toggle for advanced 3d rendering
00074  *
00075  * Revision 1.26  2005/02/25 20:30:49  mju
00076  * Move groupview to own header.
00077  *
00078  * Revision 1.25  2005/02/25 18:54:09  mju
00079  * Declare device_mem32rgba.
00080  *
00081  * Revision 1.24  2005/02/24 18:52:13  mju
00082  * Add groupview methods for overlay device.
00083  *
00084  * Revision 1.23  2005/02/23 18:52:23  mju
00085  * Add groupview stuff for overlsy.
00086  *
00087  * Revision 1.22  2005/02/14 18:52:38  mju
00088  * Add groupview class.
00089  *
00090  * Revision 1.21  2005/01/20 16:54:11  mju
00091  * Add createflags.
00092  * Drawmode enum.
00093  *
00094  * Revision 1.20  2004/09/03 22:51:34  dwilliss
00095  * Added an enum, member to hold it and Get/Set methods
00096  *
00097  * Revision 1.19  2004/08/27 21:55:32  mju
00098  * Set clip region not supported.
00099  *
00100  * Revision 1.18  2004/08/12 16:59:53  dglasser
00101  * Added destroy layer for sml func.
00102  *
00103  * Revision 1.17  2004/07/30 14:20:17  mju
00104  * Add groupflag_noLegacyRectExtents.
00105  *
00106  * Revision 1.16  2004/07/27 17:44:36  mju
00107  * Add groupflag to not clip to rectangle.
00108  *
00109  * Revision 1.15  2004/07/20 13:14:47  mju
00110  * Use new region2d hdr.
00111  *
00112  * Revision 1.14  2004/07/14 20:12:40  mju
00113  * No more mapprojparm.
00114  *
00115  * Revision 1.13  2004/07/08 21:23:56  mju
00116  * Docs for setupequirectangular.
00117  *
00118  * Revision 1.12  2004/06/30 22:11:23  mju
00119  * Make setupequirectangular public.
00120  *
00121  * Revision 1.11  2004/06/28 20:30:24  mju
00122  * Wanted getfullregion to return reference.
00123  *
00124  * Revision 1.10  2004/06/28 17:53:09  mju
00125  * Convert to spatref.
00126  *
00127  * Revision 1.9  2004/02/18 21:16:21  mju
00128  * Add GetLayerZoom1X.
00129  *
00130  * Revision 1.8  2003/11/12 22:41:42  mju
00131  * Use serializer to log errors instead of group.
00132  *
00133  * Revision 1.7  2003/11/10 18:43:35  mju
00134  * Remove savefilename/inode as need in base.
00135  *
00136  * Revision 1.5  2003/09/15 13:48:59  fileserver!dwilliss
00137  * Doxygen
00138  *
00139  * Revision 1.4  2003/08/29 20:13:43  mju
00140  * Add v_GetExtents.
00141  *
00142  * Revision 1.3  2003/07/30 14:58:25  mju
00143  * Ignore private sections.
00144  *
00145  * Revision 1.2  2003/07/29 19:58:55  mju
00146  * Add SetNeedUpdateExtents.
00147  *
00148  * Revision 1.1  2003/06/16 19:39:31  mju
00149  * Initial revision
00150  *
00151  * \endif
00152 **/
00153 
00154 #ifndef  INC_GRE_GROUP_H
00155 #define  INC_GRE_GROUP_H
00156 
00157 #ifndef  INC_GRE_VIEWABLE_H
00158    #include <gre/viewable.h>
00159 #endif
00160 
00161 #ifndef  INC_GRE_LAYER_H
00162    #include <gre/layer.h>
00163 #endif
00164 
00165 #ifndef  INC_MI32_MATTE_H
00166    #include <mi32/matte.h>
00167 #endif
00168 
00169 #ifndef INC_MI32_REGION2D_H
00170    #include <mi32/region2d.h>
00171 #endif
00172 
00173 class GEOCAT_DIALOG;
00174 
00175 namespace GRE {
00176 //===================================================================================================================
00177 
00178 #define  GROUPFLAG_None                   0x00000000
00179 #define  GROUPFLAG_Ignore                 0x00000001  //!< Completely ignores group for positioning/display
00180 #define  GROUPFLAG_NoFixAspectLL          0x00000002  //!< Don't perform "aspect correction" if viewed in lat/lon projection
00181 #define  GROUPFLAG_SingleLayer            0x00000004  //!< Group can only contain a single layer (other than background)
00182 #define  GROUPFLAG_Clip                   0x00000008  //!< Clip layers in group to specified region
00183 #define  GROUPFLAG_OrientMatchRasterOnly  0x00000010  //!< Match first raster layer or nothing if no raster
00184 #define  GROUPFLAG_OrientMatchRasterOther 0x00000020  //!< Match first raster layer or first layer if no raster
00185 #define  GROUPFLAG_OrientMatchLayer       0x00000040  //!< Match first layer
00186 #define  GROUPFLAG_3D                     0x00000200  //!< 3-D group in a layout
00187 #define  GROUPFLAG_ShowLatLonCoords       0x00001000  //!< Show group coordinates in lat-lon
00188 #define  GROUPFLAG_NoLockZoom             0x00004000  //!< Don't lock group zoom factor
00189 #define  GROUPFLAG_ShowLayerList          0x00008000  //!< Show list of layers for group
00190 #define  GROUPFLAG_NoClipToAttachedGroup  0x00010000  //!< Don't clip to attached group if that group is clipped
00191 #define  GROUPFLAG_CombineLayersInLegend  0x00020000  //!< Combine layers within group in LegendView by showing only legend for active layer
00192 #define  GROUPFLAG_TemplateSaveLayersAsIs 0x00040000  //!< Save layers as-is to template
00193 #define  GROUPFLAG_NoClipToRectOnly       0x00080000  //!< Don't force clipping to just be rectangle (for legacy layouts)
00194 #define  GROUPFLAG_NoLegacyRectExtents    0x00100000  //!< Don't just use layer rectangle when compute extents (for legacy layouts)
00195 #define  GROUPFLAG_CreatedBySML           0x00200000  //!< Group was created by SML
00196 
00197 #define  GROUPFLAG_OrientMask             0x00000070
00198 #define  GROUPFLAG_NoNotifyMask           GROUPFLAG_TemplateSaveLayersAsIs
00199 #define  GROUPFLAG_Mask_NoRedraw          (GROUPFLAG_ShowLatLonCoords | GROUPFLAG_NoLockZoom | GROUPFLAG_ShowLayerList | GROUPFLAG_CombineLayersInLegend | GROUPFLAG_TemplateSaveLayersAsIs)
00200 
00201 #define  ATTACHMENT_None         0
00202 #define  ATTACHMENT_Left         1
00203 #define  ATTACHMENT_Bottom       1
00204 #define  ATTACHMENT_Center       2
00205 #define  ATTACHMENT_Right        3
00206 #define  ATTACHMENT_Top          3
00207 #define  ATTACHMENT_Geographic   4
00208 
00209 #define  ATTACHREF_None          0
00210 #define  ATTACHREF_Group         1
00211 #define  ATTACHREF_Page          2
00212 #define  ATTACHREF_Margin        3
00213 
00214 
00215 class GROUP : public GRE::VIEWABLE, public SERIALIZABLE {
00216 
00217    public:
00218 
00219       //! Flags for group creation.
00220       enum CREATEFLAGS {
00221          CREATEFLAG_None =             0x0000,
00222          CREATEFLAG_NoCallCreateCB =   0x0001,  //!< Don't call callback list when object created
00223          CREATEFLAG_Temporary =        0x0002,  //!< Object is temporary
00224          CREATEFLAG_3D =               0x0004,  //!< Group is 3D
00225          CREATEFLAG_NoAutoMatch =      0x0008,  //!< Don't default to automatch any layers
00226          CREATEFLAG_NoSetActive =      0x0010,  //!< Don't make newly-created group "active"
00227          CREATEFLAG_DeferCreate =      0x0020,  //!< Defer creation until Create() called (standalone group only)
00228          CREATEFLAG_SML =              0x0040   //!< Being created by SML (standalone group only)
00229          };
00230 
00231       enum ORIENTATION_BASE {
00232          ORIENTATION_BASE_Projection =    0,
00233          ORIENTATION_BASE_North =         1
00234          };
00235 
00236       enum LABEL_MANAGEMENT_MODE {
00237          LABEL_MANAGEMENT_MODE_RenderWithLayer = 0,
00238          LABEL_MANAGEMENT_MODE_RenderLast
00239          };
00240 
00241       //! Used with GetExtents().
00242       enum EXTENTCOORD {
00243          EXTENTCOORD_Group,
00244          EXTENTCOORD_Layout,
00245          EXTENTCOORD_View
00246          };
00247 
00248       //! Layout/Positioning parameters
00249       struct POSN {
00250          GROUP *refgroup;
00251          UINT8 AttachRefType;                //!< Reference type, ATTACHREF_...
00252          UINT8 AttachmentThis;               //!< Attachment type for this group (ATTACHMENT_...)
00253          UINT8 AttachmentRef;                //!< Attachment type for reference group
00254          UINT8 PosnSet;
00255          double offset;                      //!< Offset in METERS at design scale
00256          mutable MISTRING m_RefGroupName;    //!< Name of reference group attached to, used when loading
00257          POSN ();
00258          ~POSN ();
00259          void Clear ();
00260          };
00261 
00262       GRE::LAYER *firstlayer;             //!< First layer in group
00263       GRE::LAYER *lastlayer;              //!< Last layer in group
00264       GRE::LAYER *activelayer;               //!< Currently active layer for group
00265       GRE::LAYER *matchedlayer;           //!< Layer matched to for auto-match options
00266       UINT8 RotBase;                      //!< Base for rotation: 0=Projection, 1=North
00267       double AspectX;
00268       double AspectY;
00269       double RotAngle;                    //!< Rotation angle
00270       double zinit;                       //!< Minimum Z value for group (unscaled)
00271       double zlast;                       //!< Maximum Z value for group (unscaled)
00272       GROUP *prevgroup;
00273       GROUP *nextgroup;
00274       GRE::LAYOUT *layout;                //!< Pointer to "parent" layout
00275       UINT32 groupflags;
00276       POSN xposn, yposn;
00277       GRE::VIEWPOINT3D *m_ViewPoint3D;    //!< 3-D viewpoint for group when used in layout
00278       UINT32 VisibleViewLayout;           //!< Bits for whether group is visible in layout views
00279 
00280    #ifdef X_NATIVE
00281       //! Get group from object attached to Widget userData
00282       static GROUP* GetFromWidget (
00283          Widget w
00284          );
00285    #endif
00286 
00287       //! Install SML class, called by internal SML function.
00288       static void SMLClassInstall (
00289          SMLCONTEXT *context                    //!< SML context
00290          );
00291 
00292       //! Construct "stand-alone" group
00293       explicit GROUP (
00294          CREATEFLAGS createflags = CREATEFLAG_None
00295          );
00296 
00297       //! Construct group within a layout
00298       GROUP (
00299          GRE::LAYOUT *layout,
00300          CREATEFLAGS createflags = CREATEFLAG_None,
00301          GRE::LISTPOS listpos = GRE::LISTPOS_Last,
00302          GROUP *refgroup = 0
00303          );
00304 
00305       //! Destructor.
00306       virtual ~GROUP ();
00307 
00308       //! Determine if lat/lon aspect adjustment will be done
00309       bool AdjLatLon (
00310          );
00311 
00312       //! Determine if option to adjust lat/lon aspect can be set
00313       bool AdjLatLonCanSet (
00314          );
00315 
00316       //! Change group position in list
00317       bool ChangeListPos (
00318          GROUP* refgroup,
00319          GRE::LISTPOS listpos
00320          );
00321 
00322       //! Check if layer of specified type can be added
00323       ERRVALUE CheckAddLayer (
00324          GRE::LAYER::TYPE layertype = GRE::LAYER::TYPE_None
00325          ) const;
00326 
00327       //! Check if georeference for layers in group are compatible
00328       void CheckGeorefCompatible (
00329          ) const;
00330 
00331       //! Compute extents of group in layout
00332       void ComputeLayoutExtents (
00333          );
00334 
00335       //! Compute map coordinate extents for group
00336       ERRVALUE ComputeMapExtents (
00337          ); 
00338 
00339       ERRVALUE ComputeRegionFromLayers (
00340          REGION2D& region,                   //!< Region returned, will be in group's RenderCoordRefSys
00341          bool IncludeMargins,                //!< Include layer margins
00342          GRE::LAYER::FILTER *filter = 0         //!< Filter
00343          ) const;
00344 
00345    #ifndef GENERATING_DOXYGEN_OUTPUT
00346       // Construct GROUPVIEW instance for this group and specified view.
00347       GRE::GROUPVIEW* ConstructGroupView (
00348          GRE::VIEW *view
00349          );
00350    #endif
00351 
00352       //! Create group if CREATEFLAG_DeferCreate was specified in constructor.
00353       void Create (
00354          CREATEFLAGS createflags = CREATEFLAG_None
00355          );
00356 
00357       //! Destroy all layers in this group
00358       void DestroyAllLayers (
00359          );
00360 
00361       //! Destroy specified layer in this group
00362       void DestroyLayer (
00363          GRE::LAYER* layer
00364          );
00365 
00366       //! Draw group overlay containing 'active' element for each layer.
00367       ERRVALUE DrawActiveOverlay (
00368          GRE::DRAWFLAGS DrawFlags = GRE::DRAWFLAG_UpdateScreen,
00369          GRE::VIEW *view = 0                    //!< View to draw overlay for, 0 for all, will be drawn first if drawing multiple
00370          );
00371 
00372    #if defined(X_NATIVE) || defined(WIN32_MFC)
00373       //! Dialog to specify group clip settings.
00374       ERRVALUE DlgGetClipSettings (
00375          MDLGPARENT dlgparent
00376          );
00377    #endif
00378 
00379       //! Find layer using unique ID.
00380       virtual GRE::LAYER *FindLayerByID (
00381          UINT32 LayerID
00382          ) const;
00383 
00384       //! Open geocatalog dialog for adding layers to group.
00385       ERRVALUE GeoCatDlgOpen (
00386          MDLGPARENT dlgparent                   //!< Parent for dialog
00387          );
00388 
00389       //! Set point for next "point search" operation in geocatalog dialog.
00390       void GeoCatDlgSetSearchPoint (
00391          const DPOINT2D& SearchPoint,           //!< Point coordinates
00392          const SPATREF::COORDREFSYS& PointCRS   //!< Point coordinate reference system
00393          ) const;
00394 
00395       //! Determine "active" layer for group.
00396       //! @return Active layer or NULL if none.
00397       GRE::LAYER* GetActiveLayer (
00398          ) const { return (activelayer); }
00399 
00400       //! Get clipping region for group.
00401       const REGION2D& GetClipRegion (
00402          ) const;
00403 
00404       //! Get setting for "clip to matched layer" regardless of whether or not will be auto-matched.
00405       bool GetClipToMatchedLayer (
00406          ) const { return (m_ClipToMatchedLayer); }
00407 
00408       //! Get extents of group in specified coordinates
00409       ERRVALUE GetExtents (
00410          DRECT2D& extents,                      //!< Group extents returned
00411          EXTENTCOORD coords                     //!< What to return extents in
00412          );
00413 
00414       //! Get first layer in group.
00415       GRE::LAYER* GetFirstLayer (
00416          ) const { return (firstlayer); }
00417 
00418       //! Get current group flag settings
00419       UINT32 GetFlags (
00420          ) const { return (groupflags); }
00421 
00422       //! Get full group name as MISTRING.
00423       virtual void GetFullName (
00424          MISTRING& name                         //!< Name returned
00425          ) const;
00426 
00427       const REGION2D& GetFullRegion (
00428          ) const { return (m_FullRegion); }
00429 
00430       LABEL_MANAGEMENT_MODE GetLabelManagementMode (
00431          ) const { return (m_LabelManagementMode); }
00432 
00433       //! Get last layer in group.
00434       GRE::LAYER* GetLastLayer (
00435          ) const { return (lastlayer); }
00436 
00437       //! Get layer to use for 1X zoom.
00438       GRE::LAYER* GetLayerZoom1X (
00439          bool PreferredOnly                     //!< Use 'preferred' layers only
00440          ) const;
00441 
00442       //! Get layout group is contained in.
00443       //! @return pointer to layout.
00444       GRE::LAYOUT * GetLayout (
00445          ) const { return (layout); }
00446 
00447       const DRECT2D& GetLayoutExtents (
00448          ) const { return (m_LayoutExtents); }
00449 
00450       //! Get current group drawing order position in list.
00451       //! @return 0 for first group, 1 for second, etc.
00452       int GetListPos (
00453          );
00454 
00455       //! Return geographically-attached reference group if any.
00456       GROUP* GetMatchedGroup (
00457          bool firstonly = false           //! True to return immediate (first link) matched group
00458          ) const;
00459 
00460       MATTE& GetMatte (
00461          ) { return (m_Matte); }
00462       
00463       //! Get "set" for mutual exclusiveness between groups.
00464       UINT32 GetMutualExclusiveGroupSet (
00465          ) const { return (m_MutualExclusiveGroupSet); }
00466 
00467       //! Get group name.
00468       const MISTRING& GetName (
00469          ) const { return (m_name); }
00470 
00471       //! Determine if need updated extents.
00472       bool GetNeedUpdateExtents (
00473          ) const { return (m_NeedUpdateExtents); }
00474 
00475       //! Get next group in layout.
00476       GROUP* GetNext (
00477          ) const { return (nextgroup); }
00478 
00479       //! Get next available unique ID.
00480       virtual UINT32 GetNextLayerID (
00481          ) const;
00482 
00483       //! Get previous group in layout.
00484       GROUP* GetPrevious (
00485          ) const { return (prevgroup); }
00486 
00487       //! Get relative scale
00488       double GetRelativeScale (
00489          ) const { return (m_RelativeScale); }
00490 
00491       //! Get rotation angle relative to base in radians
00492       double GetRotationAngle (
00493          ) const { return (RotAngle); }
00494 
00495       //! Get serializer instance being used to load group.
00496       //! @return Pointer to SERIALIZER, NULL if not being loaded.
00497       SERIALIZER* GetSerializer (
00498          ) const { return (m_pSerializer); }
00499 
00500       //! Compute dimensions of object based on scale and georeference
00501       virtual ERRVALUE GetSizeMeters (
00502          DPOINT2D& sizemeters                   //!< Size returned in meters
00503          );
00504 
00505       //! Get transformation from group to view.
00506       const TRANS2D_AFFINE& GetTransViewToGroup (
00507          ) const { return (m_ViewToGroup); }
00508 
00509       //! Get CoordRefSys used for rendering.
00510       const SPATREF::COORDREFSYS& GetUsedCoordRefSys (
00511          ) const;
00512 
00513       GRE::VIEWPOINT3D* GetViewPoint3D (
00514          ) const { return (m_ViewPoint3D); }
00515 
00516       //! Get visibility bits.
00517       UINT32 GetVisible (
00518          ) const { return (this->VisibleViewLayout); }
00519 
00520       //! Get scale range over which group is visible
00521       void GetVisibleScaleRange (
00522          double& MinScaleVisible,            //!< Minimum scale visible returned, 0 for no minimum
00523          double& MaxScaleVisible             //!< Maximum scale visible returned, 0 for no maximum
00524          ) { MinScaleVisible = m_MinScaleVisible; MaxScaleVisible = m_MaxScaleVisible; return; }
00525 
00526       //! Determine if group has other groups attached to it
00527       bool HasAttachedGroups (
00528          ) const;
00529 
00530       //! Determine if any layers in group have "highlightable" elements.
00531       bool HasHighlightableLayer (
00532          GRE::VIEW *view = 0                    //!< Reference view for layer visibility test
00533          ) const;
00534 
00535       //! Determine if group has any layers
00536       virtual bool HasLayers (
00537          ) const;
00538 
00539       //! Determine if group has a legend.
00540       bool HasLegend (
00541          ) const { return ((this->groupflags & GROUPFLAG_CombineLayersInLegend) != 0); }
00542 
00543       //! Determine if group has mutually-exclusive layers
00544       bool HasMutuallyExclusiveLayers (
00545          ) const { return (m_HasMutuallyExclusiveLayers); }
00546 
00547       //! Determine if group has any temporary layers
00548       bool HasTempLayers (
00549          ) const;
00550 
00551       //! Setup for default highlighting of layer elements.
00552       void HighlightSetupDefault (
00553          GRE::VIEW *view = 0                    //!< Optional view for determining layer visibility
00554          );
00555 
00556       //! Invalidate all view buffers for this group.
00557       void InvalidateAllViews (
00558          GRE::RENDERTARGET Target = GRE::RENDERTARGET_GroupAll | GRE::RENDERTARGET_LayerAll
00559          );
00560 
00561       //! Determine if group can be viewed in 3D
00562       bool Is3D (
00563          ) const { return (!layout || (groupflags & GROUPFLAG_3D)); }
00564 
00565       bool IsBeingLoaded (
00566          ) const { return (m_pSerializer != 0); }
00567 
00568       //! Determine if group is to be clipped.
00569       bool IsClipped (
00570          ) const;
00571 
00572       //! Determine if group is to be clipped to the auto-matched layer.
00573       bool IsClippedToMatchedLayer (
00574          ) const { return (m_ClipToMatchedLayer && GetMatchedLayer() != 0); }
00575 
00576       //! Determine if group has been created.
00577       //! This is done automatically by constructor unless CREATEFLAG_DeferCreate was specified.
00578       bool IsCreated (
00579          ) const { return (m_IsCreated); }
00580 
00581       //! Determine if group should be ignored for extents determination
00582       bool IsIgnored (
00583          ) const;
00584 
00585       //! Determine if group only allows a single layer
00586       bool IsSingleLayer (
00587          ) const { return ((groupflags & GROUPFLAG_SingleLayer) != 0); }
00588 
00589       //! Determine if group is a valid object
00590       bool IsValid (
00591          ) const;
00592 
00593       //! Determine if group visible at specified scale
00594       bool IsVisibleAtScale (
00595          double scale
00596          ) const { return (!layout || (scale >= m_MinScaleVisible && (m_MaxScaleVisible <= 0.0 || scale <= m_MaxScaleVisible))); }
00597 
00598       //! Determine if group is visible in specified view.
00599       bool IsVisibleInView (
00600          const GRE::VIEW *view
00601          ) const;
00602 
00603       //! Read from serialization
00604       virtual ERRVALUE SerialRead (
00605          SERIALIZER& serializer
00606          );
00607 
00608       //! Write values to serialization
00609       virtual ERRVALUE SerialWrite (
00610          SERIALIZER& serializer,
00611          const char *tagname = 0
00612          ) const;
00613 
00614       //! Set group to 2D
00615       void Set2D (
00616          );
00617 
00618       //! Set active layer for group
00619       void SetActiveLayer (
00620          GRE::LAYER *layer                      //!< Layer to make active
00621          );
00622 
00623       //! Set clipping rectangle.
00624       void SetClipRect (
00625          const DRECT2D& ClipRect,               //!< Rectangle to clip to
00626          const SPATREF::COORDREFSYS& RectCRS,   //!< Rectangle CRS
00627          bool notify = true
00628          );
00629 
00630       //! Set clipping region.
00631 //    void SetClipRegion (
00632 //       const REGION2D& ClipRegion,            //!< Clip region
00633 //       bool notify = true
00634 //       );
00635 
00636       //! Set whether to clip to 'auto-matched' layer
00637       void SetClipToMatchedLayer (
00638          bool ClipToMatchedLayer,               //!< 'true' to clip, 'false' to not
00639          bool notify = true                     //!< Send ACTION_ChangeBegin/End notification
00640          );
00641 
00642       //! Set specified group flags
00643       void SetFlags (
00644          UINT32 flags,                          //!< GROUPFLAG_... flag values
00645          UINT32 mask                            //!< GROUPFLAG_... mask for which flags to change
00646          );
00647 
00648       void SetLabelManagementMode (
00649          LABEL_MANAGEMENT_MODE mode
00650          ) { m_LabelManagementMode = mode; }
00651 
00652       //! Set group position in list
00653       void SetListPos (
00654          int newpos                             //!< New list position
00655          );
00656 
00657       //! Set group to "modified" status
00658       void SetModified (
00659          bool notify = true,                    //!< Set to invoke callbacks with "Changed" message
00660          bool ViewsNeedRedraw = true            //!< Set all views of group as needing redraw
00661          );
00662 
00663       //! Set "group set" which group is mutually-exclusive with.
00664       void SetMutualExclusiveGroupSet (
00665          UINT32 GroupSet                        //!< Group set bits
00666          );
00667 
00668       //! Set whether layers are mutually-exclusive.
00669       void SetMutuallyExclusiveLayers (
00670          bool LayersMutuallyExclusive = true
00671          );
00672 
00673       //! Set group name.
00674       ERRVALUE SetName (
00675          const MISTRING& newname                //!< New name
00676          );
00677 
00678       //! Set group to recompute extents.
00679       void SetNeedUpdateExtents (
00680          ) { m_NeedUpdateExtents = true; }
00681 
00682       //! Set group rotation base and orientation.
00683       void SetOrientation (
00684          UINT8 NewRotBase,                      //!< ROTBASE_Projection or ROTBASE_North
00685          double NewRotAngle                     //!< Rotation angle, radians clockwise relative to base
00686          ) { RotBase = NewRotBase; RotAngle = NewRotAngle; }
00687 
00688       //! Set group projection to match specified layer
00689       void SetProjView (
00690          const GRE::LAYER *layer                //!< Layer to obtain projection from, NULL to match first raster/layer
00691          );
00692 
00693       //! Set group scale relative to layout design scale.
00694       void SetRelativeScale (
00695          double RelativeScale,
00696          bool notify = true
00697          );
00698 
00699       //! Set coordinate reference system to render group in.
00700       ERRVALUE SetRenderCoordRefSys (
00701          const SPATREF::COORDREFSYS& RenderCRS
00702          );
00703 
00704       //! Setup equirectangular CRS based on group datum.
00705       ERRVALUE SetupEquirectangular (
00706          SPATREF::COORDREFSYS& CoordRefSys,     //!< Coordinate Reference System definition returned
00707          const DPOINT2D& center                 //!< Projection center in CRS used by group
00708          ) const;
00709 
00710       //! Set group visibility in specified views
00711       void SetVisible (
00712          UINT32 flags,                          //!< Bits indicating which views to modify visibility for
00713          bool set                               //!< true if visible, false if not
00714          );
00715 
00716       //! Set scale range over which group is visible
00717       void SetVisibleScaleRange (
00718          double MinScaleVisible,
00719          double MaxScaleVisible
00720          ) { m_MinScaleVisible = MinScaleVisible; m_MaxScaleVisible = MaxScaleVisible; }
00721 
00722       //! Set group visibility in specified view
00723       void SetVisibleView (
00724          GRE::VIEW *view,                       //!< View to set visibility for
00725          bool visible                           //!< true if visible, false if not
00726          );
00727 
00728       //! Write template to serialization
00729       ERRVALUE TemplateWrite (
00730          SERIALIZER& serializer,
00731          const char *tagname = 0
00732          );
00733       
00734    private:
00735 
00736       #ifndef GENERATING_DOXYGEN_OUTPUT
00737 
00738    #ifdef X_NATIVE
00739       GEOCAT_DIALOG *m_GeoCatDlg;
00740    #endif
00741 
00742       SERIALIZER *m_pSerializer;             // Set while group is being loaded
00743       bool m_IsCreated;
00744       bool m_NeedUpdateExtents;              // Extents need to be recomputed
00745       double m_MinScaleVisible;
00746       double m_MaxScaleVisible;
00747       double m_DesignScale;                  // Group Design scale
00748       double m_RelativeScale;                // Scale relative to layout Design scale
00749       mutable MISTRING m_ActiveLayerName;
00750       bool m_ClipToMatchedLayer;
00751       bool m_HasMutuallyExclusiveLayers;
00752       GRE::HIGHLIGHTMODE m_ElemHighlightMode;
00753       UINT32 m_MutualExclusiveGroupSet;
00754       MATTE m_Matte; 
00755       MISTRING m_name;
00756       SPATREF::COORDREFSYS m_RenderCRS;      // Coordinate reference system group rendered in if not auto-matched
00757       REGION2D m_ClipRegion;                 // Clip region
00758       REGION2D m_FullRegion;                 // Union of all layer regions in group's render CRS
00759       TRANS2D_AFFINE m_ViewToGroup;
00760       DRECT2D m_LayoutExtents;               // Extents in layout coordinates
00761       LABEL_MANAGEMENT_MODE m_LabelManagementMode;
00762 
00763       static void GRECB_Group (
00764          const GRE::MSG *msg,
00765          void *vgroup
00766          );
00767 
00768       static const SERIALIZER::ITEMDEF* SerialGetItemDef (
00769          SERIALIZER& serializer
00770          );
00771 
00772       static ERRVALUE SerializerCB_OldClipProj (SERIALIZER&, const SERIALIZER::ITEMDEF*, void *vgroup, SERIALIZER::ITEMDEF::ACTION);
00773       static ERRVALUE SerializerCB_OldClipRect (SERIALIZER&, const SERIALIZER::ITEMDEF*, void *vgroup, SERIALIZER::ITEMDEF::ACTION);
00774       static ERRVALUE SerializerCB_OldGroupFlags (SERIALIZER&, const SERIALIZER::ITEMDEF*, void *vgroup, SERIALIZER::ITEMDEF::ACTION);
00775 
00776       void Init ();
00777 
00778       //! Determine layer group projection will be auto-matched to
00779       GRE::LAYER *GetMatchedLayer () const;
00780 
00781       // GRE::OBJECT overrides.
00782       virtual bool v_Destroy (bool NotifyParent);
00783       virtual MICON v_GetIcon () const;
00784       virtual const char* v_GetTypeName () const;
00785 
00786       // GRE::VIEWABLE overrides.
00787       virtual ERRVALUE v_DrawAllViews (GRE::DRAWCONDITION condition);
00788       virtual double v_GetDesignScale () const;
00789       virtual const DRECT2D& v_GetExtents () const;
00790       virtual double v_GetMaxScaleVisibleAny () const;
00791       virtual double v_GetMinScaleVisibleAny () const;
00792       virtual void v_SetDesignScale (double DesignScale, bool notify);
00793 
00794       GROUP (const GROUP&);
00795       GROUP& operator= (const GROUP&);
00796 
00797       friend class GRE::LAYOUT;
00798 
00799       #endif //!< GENERATING_DOXYGEN_OUTPUT
00800    };
00801 
00802 DEFINE_ENUM_OP_BITWISE(GROUP::CREATEFLAGS)
00803 
00804 
00805 //===================================================================================================================
00806 }  // End namespace GRE
00807 
00808 #endif   //!< INC_GRE_GROUP_H

Generated on Thu Apr 26 04:44:39 2007 for TNTsdk by  doxygen 1.5.2