CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndLocalModuleRendition.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// Basic interface local module rendition's
24
25#ifndef ODTRRNDLOCALMODULERENDITION
26#define ODTRRNDLOCALMODULERENDITION
27
28#include "TD_PackPush.h"
29
31#include "TrRndRenderModule.h"
32
37{
38 protected:
40 {
41 protected:
44 public:
47 { m_pClientContext = pClientCtx; m_pRenderModule = pRndModule; }
48
51
54
59 if (pLC.isNull() && !m_pRenderModule.isNull())
60 pLC = m_pRenderModule->createLocalContext(pDevice);
61 return pLC;
62 }
64 public:
67
69 {
70 m_clientContext.setup(pClient, pModule);
71 }
74
75 // OdTrRndLocalRenditionHost interface
76
77 // Returns managed rendition
78 virtual OdTrVisRendition *rendition() { return this; }
79 virtual const OdTrVisRendition *rendition() const { return this; }
80 protected: // Stub other OdTrRndLocalRenditionHost methods
81 // Returns render settings manager
83 virtual const OdTrRndRenderSettingsManager* renderSettingsManager() const { ODA_FAIL(); return NULL; }
84 // Context data storage management
85 virtual bool hasContextData() const { ODA_FAIL(); return false; }
86 virtual void processContextData(bool /*bStore*/) { ODA_FAIL(); }
87 // Resource accessors
88 virtual bool getMetafileDef(OdTrVisMetafileId /*metafileId*/, OdTrVisMetafileDef & /*mfDef*/) const { ODA_FAIL(); return false; }
89 virtual bool getMaterialDef(OdTrVisMaterialId /*materialId*/, OdTrVisMaterialDef & /*mtDef*/) const { ODA_FAIL(); return false; }
90 // Property accessors
91 virtual OdUInt32 hasProperties(OdTrVisRendition::DataType /*dataType*/, OdTrVisId /*resId*/) const { ODA_FAIL(); return 0; }
92 virtual bool getPropertyDef(OdTrVisRendition::DataType /*dataType*/, OdTrVisId /*resId*/, OdTrVisPropertyDef::PropertyType /*propType*/,
93 OdTrVisPropertyDef *& /*pPropDef*/) const { ODA_FAIL(); return false; }
94 // Ability to make shareable properties clone
95 virtual bool supportShallowPropertiesClone(OdTrVisMetafileContainer * /*pMfStream*/) const { return false; }
96 virtual bool shallowPropertiesClone(OdTrVisMetafileContainer * /*pMfStream*/) { ODA_FAIL(); return false; }
97 protected:
98 virtual bool generateLinetypeTexture(OdPs::LineType ltpId, OdUInt8Array &outPixels, OdUInt8 forePixVal) const
99 {
100 if (clientContext())
101 return clientContext()->generateLinetypeTexture(ltpId, outPixels, forePixVal);
102 return false;
103 }
104 virtual bool generateFilltypeTexture(OdPs::FillStyle fsId, OdUInt8Array &outPixels, OdUInt32 dimX, OdUInt32 dimY, OdUInt8 forePixVal) const
105 {
106 if (clientContext())
107 return clientContext()->generateFilltypeTexture(fsId, outPixels, dimX, dimY, forePixVal);
108 return false;
109 }
110};
111
112#include "TD_PackPop.h"
113
114#endif // ODTRRNDLOCALMODULERENDITION
#define ODA_FAIL()
Definition: DebugStuff.h:88
unsigned int OdUInt32
unsigned char OdUInt8
bool isNull() const
Definition: BaseObjectPtr.h:86
const OdTrRndLocalRenditionClient * clientContext() const
void setup(OdTrRndLocalRenditionClient *pClientCtx, OdTrRndRenderModule *pRndModule)
OdTrRndLocalContextPtr createLocalContext(OdTrVisRenderClient *pDevice)
virtual void setupClientContext(OdTrRndLocalRenditionClient *pClient, OdTrRndRenderModule *pModule)
virtual bool getPropertyDef(OdTrVisRendition::DataType, OdTrVisId, OdTrVisPropertyDef::PropertyType, OdTrVisPropertyDef *&) const
virtual bool getMetafileDef(OdTrVisMetafileId, OdTrVisMetafileDef &) const
OdTrRndLocalRenditionClient * clientContext()
virtual bool shallowPropertiesClone(OdTrVisMetafileContainer *)
virtual bool getMaterialDef(OdTrVisMaterialId, OdTrVisMaterialDef &) const
virtual const OdTrRndRenderSettingsManager * renderSettingsManager() const
virtual const OdTrVisRendition * rendition() const
virtual bool supportShallowPropertiesClone(OdTrVisMetafileContainer *) const
virtual bool generateLinetypeTexture(OdPs::LineType ltpId, OdUInt8Array &outPixels, OdUInt8 forePixVal) const
virtual OdUInt32 hasProperties(OdTrVisRendition::DataType, OdTrVisId) const
virtual OdTrVisRendition * rendition()
virtual bool generateFilltypeTexture(OdPs::FillStyle fsId, OdUInt8Array &outPixels, OdUInt32 dimX, OdUInt32 dimY, OdUInt8 forePixVal) const
class OdTrRndLocalModuleRendition::LocalRenditionClient m_clientContext
const OdTrRndLocalRenditionClient * clientContext() const
virtual OdTrRndRenderSettingsManager * renderSettingsManager()
virtual bool generateFilltypeTexture(OdPs::FillStyle, OdUInt8Array &, OdUInt32, OdUInt32, OdUInt8) const
virtual OdTrRndLocalContextPtr createLocalContext(OdTrVisRenderClient *)
virtual bool generateLinetypeTexture(OdPs::LineType, OdUInt8Array &, OdUInt8) const
virtual OdTrRndLocalContextPtr createLocalContext(OdTrVisRenderClient *pDevice)=0
LineType
Definition: PlotStyles.h:89
FillStyle
Definition: PlotStyles.h:53