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

Generated on Thu Apr 26 04:03:32 2007 for TNTsdk by  doxygen 1.5.2