CFx SDK Documentation  2020SP3
Public Member Functions | List of all members
OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase > Class Template Reference

#include <GsInterfaceWrappers.h>

Inheritance diagram for OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >:
OdGsDefaultRedirectionBase< OdGsDevice, OdGsDevice > OdGsDevice OdRxObject

Public Member Functions

 OdGsDeviceWrapper (OdGsDevice *pRedirectionDevice=NULL)
 
OdRxDictionaryPtr properties ()
 
OdGiContextuserGiContext () const
 
void setUserGiContext (OdGiContext *pUserGiContext)
 
void invalidate ()
 
void invalidate (const OdGsDCRect &screenRect)
 
bool isValid () const
 
void update (OdGsDCRect *pUpdatedRect=0)
 
void onSize (const OdGsDCRect &outputRect)
 
void onSize (const OdGsDCRectDouble &outputRect)
 
void getSize (OdGsDCRect &outputRect) const
 
void getSize (OdGsDCRectDouble &outputRect) const
 
void onRealizeForegroundPalette ()
 
void onRealizeBackgroundPalette ()
 
void onDisplayChange (int bitsPerPixel, int xPixels, int yPixels)
 
OdGsViewPtr createView (const OdGsClientViewInfo *pViewInfo=0, bool enableLayerVisibilityPerView=false)
 
void addView (OdGsView *pView)
 
OdGsModelPtr createModel ()
 
bool isModelCompatible (OdGsModel *pModel) const
 
bool saveDeviceState (OdGsFiler *pFiler) const
 
bool loadDeviceState (OdGsFiler *pFiler)
 
void insertView (int viewIndex, OdGsView *pView)
 
bool eraseView (OdGsView *pView)
 
bool eraseView (int viewIndex)
 
void eraseAllViews ()
 
int numViews () const
 
OdGsViewviewAt (int viewIndex)
 
bool setBackgroundColor (ODCOLORREF backgroundColor)
 
ODCOLORREF getBackgroundColor ()
 
void setLogicalPalette (const ODCOLORREF *logicalPalette, int numColors)
 
const ODCOLORREFgetLogicalPalette (int &numColors) const
 
void getSnapShot (OdGiRasterImagePtr &pImage, const OdGsDCRect &region)
 
OdGsUpdateManagerPtr getUpdateManager (bool createIfNotExist)
 
void setUpdateManager (OdGsUpdateManagerPtr pManager)
 
- Public Member Functions inherited from OdGsDefaultRedirectionBase< OdGsDevice, OdGsDevice >
 OdGsDefaultRedirectionBase (OdGsDevice *pRedirectionObj=NULL)
 
bool hasRedirection () const
 
const OdGsDeviceredirection () const
 
OdGsDeviceredirection ()
 
void setRedirection (OdGsDevice *pRedirectionObj)
 
void resetRedirection ()
 
- Public Member Functions inherited from OdGsDevice
 ODRX_DECLARE_MEMBERS (OdGsDevice)
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
class OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >

Base template for OdGsDevice class wrappers.

Corresponding C++ library: TD_Gs

<group OdGs_Classes>

Definition at line 708 of file GsInterfaceWrappers.h.

Constructor & Destructor Documentation

◆ OdGsDeviceWrapper()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::OdGsDeviceWrapper ( OdGsDevice pRedirectionDevice = NULL)
inline

Definition at line 715 of file GsInterfaceWrappers.h.

Member Function Documentation

◆ addView()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::addView ( OdGsView pView)
inlinevirtual

Associates the specified Viewport object with this Device object.

Parameters
pView[in] Pointer to the OdGsView object.

Implements OdGsDevice.

Definition at line 807 of file GsInterfaceWrappers.h.

◆ createModel()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGsModelPtr OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::createModel ( )
inlinevirtual

Creates a new OdGsModel object, and associates it with this Device object.

Returns
Returns a SmartPointer to the newly created object.

Implements OdGsDevice.

Definition at line 813 of file GsInterfaceWrappers.h.

◆ createView()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGsViewPtr OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::createView ( const OdGsClientViewInfo pViewInfo = 0,
bool  enableLayerVisibilityPerView = false 
)
inlinevirtual

Creates a new OdGsView object, and associates it with this Device object.

Parameters
pViewInfo[in] Pointer to the Client View Information for this Device object.
enableLayerVisibilityPerView[in] Layer visibility per viewport is supported, if and only if true.
Returns
Returns a SmartPointer to the newly created object.

pViewInfo contains information returned by OdGiViewport::acadWindowId() and OdGiViewportDraw::viewportObjectId()

Implements OdGsDevice.

Definition at line 801 of file GsInterfaceWrappers.h.

◆ eraseAllViews()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::eraseAllViews ( )
inlinevirtual

Erases all views associated with this Device object.

Implements OdGsDevice.

Definition at line 856 of file GsInterfaceWrappers.h.

◆ eraseView() [1/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::eraseView ( int  viewIndex)
inlinevirtual

Erases the specified View object.

Parameters
viewIndex[in] View index.
Returns
Returns true if and only if successful.

Implements OdGsDevice.

Definition at line 850 of file GsInterfaceWrappers.h.

◆ eraseView() [2/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::eraseView ( OdGsView pView)
inlinevirtual

Erases the specified View object.

Parameters
pView[in] Pointer to the OdGsView object.
Returns
Returns true if and only if successful.

Implements OdGsDevice.

Definition at line 844 of file GsInterfaceWrappers.h.

◆ getBackgroundColor()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
ODCOLORREF OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getBackgroundColor ( )
inlinevirtual

Returns the Background Color of the GUI window of this Device object.

Implements OdGsDevice.

Definition at line 880 of file GsInterfaceWrappers.h.

◆ getLogicalPalette()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
const ODCOLORREF* OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getLogicalPalette ( int &  numColors) const
inlinevirtual

Returns the logical pallete used by this Device object.

Parameters
numColors[out] Number of colors in palette.

Implements OdGsDevice.

Definition at line 892 of file GsInterfaceWrappers.h.

◆ getSize() [1/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getSize ( OdGsDCRect outputRect) const
inlinevirtual

Returns device surface output rectangle.

Parameters
outputRect[out] Obtains size of the output rectangle in device coordinates (pixels).

Implements OdGsDevice.

Definition at line 774 of file GsInterfaceWrappers.h.

◆ getSize() [2/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getSize ( OdGsDCRectDouble outputRect) const
inlinevirtual

Returns device surface output rectangle.

Parameters
outputRect[out] Obtains size of the output rectangle in device coordinates (pixels).

Reimplemented from OdGsDevice.

Definition at line 779 of file GsInterfaceWrappers.h.

◆ getSnapShot()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getSnapShot ( OdGiRasterImagePtr pImage,
const OdGsDCRect region 
)
inlinevirtual

Returns image of current device buffer.

Parameters
pImage[out] Pointer for image to return.
region[in] Rectangle specifies region to return.
Remarks
Implementation can throw eNotImplementedYet exception if current vectorization module doesn't support snap shots.

Implements OdGsDevice.

Definition at line 899 of file GsInterfaceWrappers.h.

◆ getUpdateManager()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGsUpdateManagerPtr OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::getUpdateManager ( bool  createIfNotExist)
inlinevirtual

Returns OdGsUpdateManager associated with current device

Parameters
createIfNotExist[in] Creates instance of OdGsUpdateManager if no one associated with device

Reimplemented from OdGsDevice.

Definition at line 905 of file GsInterfaceWrappers.h.

◆ insertView()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::insertView ( int  viewIndex,
OdGsView pView 
)
inlinevirtual

Inserts the specified Viewport object to the specified position in this Device object.

Parameters
viewIndex[in] View index.
pView[in] Pointer to the OdGsView object.

Implements OdGsDevice.

Definition at line 839 of file GsInterfaceWrappers.h.

◆ invalidate() [1/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::invalidate ( )
inlinevirtual

Marks for refresh the specified region of the GUI window of this Device object.

Parameters
screenRect[in] Rectangular area.
Remarks
If screenRect is not specified, the entire GUI window is marked for refresh.

Implements OdGsDevice.

Definition at line 740 of file GsInterfaceWrappers.h.

◆ invalidate() [2/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::invalidate ( const OdGsDCRect screenRect)
inlinevirtual

Implements OdGsDevice.

Definition at line 745 of file GsInterfaceWrappers.h.

◆ isModelCompatible()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::isModelCompatible ( OdGsModel pModel) const
inlinevirtual

Checks compatibility between specified OdGsModel and this Device object.

Parameters
pModel[in] Model object pointer to check compatibility.
Remarks
Use this method to check compatibility of exist Model object and newly created device to be sure the exist Model object could be used with this Device object.

By default this always returns false. It is must be implemented in inherited classes to enable Model object reuse support. If Device object use overriden Model object it should return false if input Model object doesn't overriden.

Typical way to check compatibility is using of RTTI.

If your metafiles cache doesn't support per-device sharing override and return false.

Reimplemented from OdGsDevice.

Definition at line 819 of file GsInterfaceWrappers.h.

◆ isValid()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::isValid ( ) const
inlinevirtual

Returns true if and only if the GUI window for this Device object is showing the correct image.

Remarks
This implies the follow: No part of GUI area is flagged for refresh. All rasterizations are complete The rendering pipeline has been flushed.

Implements OdGsDevice.

Definition at line 750 of file GsInterfaceWrappers.h.

◆ loadDeviceState()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::loadDeviceState ( OdGsFiler pFiler)
inlinevirtual

Restores device state from filer object.

Parameters
pFiler[in] Filer object.

Reimplemented from OdGsDevice.

Definition at line 832 of file GsInterfaceWrappers.h.

◆ numViews()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
int OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::numViews ( ) const
inlinevirtual

Returns the number of views associated with this Device object.

Implements OdGsDevice.

Definition at line 861 of file GsInterfaceWrappers.h.

◆ onDisplayChange()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::onDisplayChange ( int  bitsPerPixel,
int  xPixels,
int  yPixels 
)
inlinevirtual

Notification function called whenever the OS screen resolution and/or color depth have changed.

Parameters
bitsPerPixel[in] Color depth.
xPixels[in] X pixels.
yPixels[in] Y pixels.
Remarks
This function is called after the operation.

Implements OdGsDevice.

Definition at line 795 of file GsInterfaceWrappers.h.

◆ onRealizeBackgroundPalette()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::onRealizeBackgroundPalette ( )
inlinevirtual

Notification function typically called whenever the GUI window for this Device object loses focus.

Remarks
Causes this Device object to realize its background pallette.

Implements OdGsDevice.

Definition at line 790 of file GsInterfaceWrappers.h.

◆ onRealizeForegroundPalette()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::onRealizeForegroundPalette ( )
inlinevirtual
Remarks
Causes this Device object to realize its foreground pallette.

Implements OdGsDevice.

Definition at line 785 of file GsInterfaceWrappers.h.

◆ onSize() [1/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::onSize ( const OdGsDCRect outputRect)
inlinevirtual

Notification function called whenever the size of the GUI window for this Device object has changed.

Parameters
outputRect[in] New size of the output rectangle in device coordinates (pixels).
Remarks
This function should not be called if this Device object has a width and/or height of 0, .

Implements OdGsDevice.

Definition at line 763 of file GsInterfaceWrappers.h.

◆ onSize() [2/2]

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::onSize ( const OdGsDCRectDouble outputRect)
inlinevirtual

Notification function called whenever the size of the GUI window for this Device object has changed.

Parameters
outputRect[in] New size of the output rectangle in device coordinates (pixels).
Remarks
This function should not be called if this Device object has a width and/or height of 0, .

Reimplemented from OdGsDevice.

Definition at line 768 of file GsInterfaceWrappers.h.

◆ properties()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdRxDictionaryPtr OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::properties ( )
inlinevirtual

Returns a SmartPointer to the dictionary containing the properties for this Device object.

Implements OdGsDevice.

Definition at line 721 of file GsInterfaceWrappers.h.

◆ saveDeviceState()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::saveDeviceState ( OdGsFiler pFiler) const
inlinevirtual

Stores current device state into filer object.

Parameters
pFiler[in] Filer object.

Reimplemented from OdGsDevice.

Definition at line 826 of file GsInterfaceWrappers.h.

◆ setBackgroundColor()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
bool OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::setBackgroundColor ( ODCOLORREF  backgroundColor)
inlinevirtual

Sets the Background Color of the GUI window of this Device object.

Parameters
backgroundColor[in] Background color.

Implements OdGsDevice.

Definition at line 874 of file GsInterfaceWrappers.h.

◆ setLogicalPalette()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::setLogicalPalette ( const ODCOLORREF logicalPalette,
int  numColors 
)
inlinevirtual

Sets the logical pallete to be used by this Device object.

Parameters
logicalPalette[in] Logical palette.
numColors[in] Number of colors in palette.
Remarks
The logical pallete is used with calls to OdGiSubEntityTraits::setColor().

Implements OdGsDevice.

Definition at line 887 of file GsInterfaceWrappers.h.

◆ setUpdateManager()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::setUpdateManager ( OdGsUpdateManagerPtr  pManager)
inlinevirtual

Associates OdGsUpdateManager with device

Parameters
pManager[in] Pointer to the OdGsUpdateManager

Reimplemented from OdGsDevice.

Definition at line 915 of file GsInterfaceWrappers.h.

◆ setUserGiContext()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::setUserGiContext ( OdGiContext pUserGiContext)
inlinevirtual

Sets the User Context object associated with this Device object.

Parameters
pUserGiContext[in] Pointer to the User Context.

Implements OdGsDevice.

Definition at line 734 of file GsInterfaceWrappers.h.

◆ update()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
void OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::update ( OdGsDCRect pUpdatedRect = 0)
inlinevirtual

Updates the GUI window for this Device object.

Parameters
pUpdatedRect[out] Pointer to the a rectangle to receive the region updated by this function.
Remarks
This function call is propagated to all OdGsView objects owned by this Device object, thus displaying the correct image on the GUI window of this Device object.

Implements OdGsDevice.

Definition at line 757 of file GsInterfaceWrappers.h.

◆ userGiContext()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGiContext* OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::userGiContext ( ) const
inlinevirtual

Returns the User Context object associated with this Device object.

Implements OdGsDevice.

Definition at line 728 of file GsInterfaceWrappers.h.

◆ viewAt()

template<typename GsDeviceInterface = OdGsDevice, typename RedirectionBase = OdGsDefaultRedirectionBase<OdGsDevice, GsDeviceInterface>>
OdGsView* OdGsDeviceWrapper< GsDeviceInterface, RedirectionBase >::viewAt ( int  viewIndex)
inlinevirtual

Returns the specified OdGsView object associated with this Device object.

Parameters
viewIndex[in] View index.

Implements OdGsDevice.

Definition at line 867 of file GsInterfaceWrappers.h.


The documentation for this class was generated from the following file: