/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// // Composite view #ifndef EXGSCOMPOSITEVIEW #define EXGSCOMPOSITEVIEW #include "TD_PackPush.h" #include "ExGsCompositeDefs.h" #include "Gs/GsBaseInclude.h" class ExGsCompositeDevice; /** \details */ class ExGsCompositeView : public OdGsBaseVectorizeViewDef , protected ExGsCompositeSyncFlags { protected: friend class ExGsCompositeDevice; enum SyncFlags { kSyncInvalidate = (1 << 0), // invalidate called kSyncGiCtx = (1 << 1), // gi context changed kSyncViewport = (1 << 2), // viewport region changed kSyncViewportClip = (1 << 3), // viewport clip region modified kSyncBorder = (1 << 4), // viewport border changed kSyncViewParam = (1 << 5), // view parameters changed (transform/lens length/clip) kSyncGraph = (1 << 6), // scene graph modified (added/removed drawables) kSyncVisibility = (1 << 7), // hide or show called kSyncLayer = (1 << 8), // frozen layers list modified kSyncLinetype = (1 << 9), // linetype settings changed kSyncLineweight = (1 << 10), // lineweight settings changed kSyncLwdEnum = (1 << 11), // lineweight enum changed kSyncClearColor = (1 << 12), // clear color changed kSyncBackground = (1 << 13), // background changed kSyncVisualStyle = (1 << 14), // visual style changed kSyncRenderMode = (1 << 15), // render mode was changed kSyncClip3d = (1 << 16) // viewport 3d clipping }; enum CompositionFlags { kCompViewAttached = (1 << 0) // real device view is attached }; OdUInt32 m_compositeFlags; OD_GS_COMPOSITE_PROP(kCompViewAttached, isCompositeViewAttached, setCompositeViewAttached); // Real device OdGsDevicePtr m_pRealDevice; // smart pointer to keep it alive OdGsModule *m_pCompModule; OdGsBaseVectorizeDevice *m_pCompDevice; OdGsBaseVectorizeView *m_pCompView; OdUInt32 m_factoryFlags; public: ODRX_USING_HEAP_OPERATORS(OdGsBaseVectorizeViewDef); ExGsCompositeView(); ~ExGsCompositeView() override; ExGsCompositeDevice* device(); OdGsModule *compositeModule() const { return m_pCompModule; } OdGsBaseVectorizeDevice *compositeDevice() const { return m_pCompDevice; } OdGsBaseVectorizeView *compositeView() const { return m_pCompView; } OdUInt32 moduleFactoryFlags() const { return m_factoryFlags; } void detachCompositeView(); void attachCompositeView(); void detachRedirectionView(); void attachRedirectionView(OdGsDevice *pDevice, OdUInt32 flags); void syncMe() const; void invalidateCachedViewportMaterials(); void invalidateAllModelCaches(); // GsView overrides void setUserGiContext(OdGiContext* pUserGiContext) override; void setLineweightToDcScale(double scale) override; void setLineweightEnum(int numLineweights, const OdUInt8* lineweights, const OdUInt16 *altSourceLwds = NULL) override; void setViewport(const OdGePoint2d& lowerLeft, const OdGePoint2d& upperRight) override; void setViewport(const OdGsDCRect& screenRect) override; void setViewport(const OdGsDCRectDouble& screenRect) override; void setViewportClipRegion(int numContours, int const* numVertices, OdGsDCPoint const* vertices) override; void setViewportClipRegion(int numContours, int const* numVertices, OdGePoint2d const* vertices) override; void setViewport3dClipping(const OdGiClipBoundary* pBoundary, const OdGiAbstractClipBoundary* pClipInfo = NULL) override; void setViewportBorderProperties(ODCOLORREF color, int width) override; void setViewportBorderVisibility(bool visible) override; void setView(const OdGePoint3d& position, const OdGePoint3d& target, const OdGeVector3d& upVector, double fieldWidth, double fieldHeight, Projection projectionType = kParallel) override; void setLensLength(double lensLength) override; void setEnableFrontClip(bool enable) override; void setFrontClip(double frontClip) override; void setEnableBackClip(bool enable) override; void setBackClip(double backClip) override; void setMode(RenderMode mode) override; bool add(OdGiDrawable* pSceneGraph, OdGsModel* pModel) override; bool erase(OdGiDrawable* sceneGraph) override; void eraseAll() override; void invalidate() override; void invalidate(const OdGsDCRect &screenRect) override; void flush() override; void hide() override; void show() override; void freezeLayer(OdDbStub* layerID) override; void thawLayer(OdDbStub* layerID) override; void clearFrozenLayers() override; void select(const OdGePoint2d* pts, int nPoints, OdGsSelectionReactor* pReactor, SelectionMode mode = kCrossing) override; bool viewExtents(OdGeBoundBlock3d& extents) const override; void dolly(const OdGeVector3d& dollyVector) override; void dolly(double xDolly, double yDolly, double zDolly) override; void roll(double rollAngle) override; void orbit(double xOrbit, double yOrbit) override; void zoom(double zoomFactor) override; void pan(double xPan, double yPan) override; void zoomExtents(const OdGePoint3d &minPt, const OdGePoint3d &maxPt) override; void zoomWindow(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight) override; bool exceededBounds() override; void initLights(OdRxIterator* pLightsIterator) override; void setLinetypeScaleMultiplier(double linetypeScaleMultiplier) override; void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier) override; void setClearColor(ClearColor color) override; void setBackground(OdDbStub *backgroundId) override; void setVisualStyle(OdDbStub *visualStyleId) override; void setVisualStyle(const OdGiVisualStyle &visualStyle) override; void getSnapShot(OdGiRasterImagePtr &pImage, const OdGsDCRect ®ion) override; // GsView overrides which controls output geometry generation/rendering void propagateLayersChanges() override; void propagateInvalidVpFlag() override; virtual void updateViewProps(); void beginViewVectorization() override; void endViewVectorization() override; void loadViewport() override; void update() override; void updateExtents(bool buildCache) override; void display(bool update) override; void drawViewportFrame() override; // GsBaseVectorizeView overrides bool isLocalViewportIdCompatible(const OdGsViewImpl *pView) const override; }; /** \details */ class ExGsProtectedViewParamsAccessor : public OdGsBaseVectorizeView { friend class ExGsCompositeDevice; friend class ExGsCompositeView; public: static ExGsProtectedViewParamsAccessor *castEx(OdGsBaseVectorizeView *pView) { return reinterpret_cast(pView); } static const ExGsProtectedViewParamsAccessor *castEx(const OdGsBaseVectorizeView *pView) { return reinterpret_cast(pView); } int &nCachedDrawables(); }; #include "TD_PackPop.h" #endif // EXGSCOMPOSITEVIEW