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

Generated on Tue Dec 14 13:18:12 2004 for TNTsdk by  doxygen 1.3.8-20040913