CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxBIMMaterial.h
Go to the documentation of this file.
1//
2// (C) Copyright 2020-2023 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxBIM.h"
20#include "FxBIMDatabase.h"
21
22#include <StringArray.h>
23#include <DbMaterial.h>
24
25class CFxBIMMaterialImpl;
26class CFxMaterialLayerSetImpl;
27
28class CFxBIMMaterial;
30
32{
33 friend class CFxBIMMaterialImpl;
34public:
36
37 virtual ~CFxBIMMaterial();
38
39 virtual bool IsEqual( CFxBIMMaterialPtr p ) const;
40 virtual bool IsSame( CFxBIMMaterialPtr p ) const;
41
42 virtual OdString Name() const;
43 virtual OdResult SetName( const OdString& name );
44
45 virtual const OdString& MappedName() const;
46 virtual void SetMappedName( const OdString& mappedName );
47
48 enum class MaterialType
49 {
50 eBasic,
51 eLayer
52 };
53
55
56 // HATCH
57
59
60 enum class PatternType
61 {
62 eHatch,
63 eCustom
64 };
65
66 virtual PatternType CutPatternType() const;
68
69 virtual const OdString& CutPatternName() const;
70 virtual void SetCutPatternName( const OdString& patternName );
71
72 virtual double CutPatternScale() const;
73 virtual void SetCutPatternScale( double patternScale );
74
75 virtual bool CutPatternScaleWithViewPort() const;
76 virtual void SetCutPatternScaleWithViewPort( bool ScaleWithViewport );
77
78 virtual double CutPatternRotation() const;
79 virtual void SetCutPatternRotation( double angle );
80
82 virtual void SetCutPatternRotationRelativeToElementBaseline( bool RotationRelativeToElementBaseline );
83
85 virtual void SetCutPatternLineweight( OdDb::LineWeight lineweight );
86
87 virtual OdCmColor CutPatternColor() const;
88 virtual void SetCutPatternColor( OdCmColor color );
89
92
93 virtual const OdString& SurfacePatternName() const;
94 virtual void SetSurfacePatternName( const OdString& patternName );
95
96 virtual double SurfacePatternScale() const;
97 virtual void SetSurfacePatternScale( double patternScale );
98
99 virtual bool SurfacePatternScaleWithViewPort() const;
100 virtual void SetSurfacePatternScaleWithViewPort( bool ScaleWithViewport );
101
102 virtual double SurfacePatternRotation() const;
103 virtual void SetSurfacePatternRotation( double angle );
104
106 virtual void SetSurfacePatternRotationRelativeToElementBaseline( bool RotationRelativeToElementBaseline );
107
110
112 virtual void SetSurfacePatternColor( OdCmColor color );
113
114 // BOUNDARY
115
116 virtual bool CutBoundaryUnify() const;
117 virtual void SetCutBoundaryUnify( bool unify );
118
120 virtual void SetCutBoundaryLineweight( OdDb::LineWeight lineweight );
121
123 virtual void SetCutBoundaryColor( OdCmColor color );
124
125 virtual bool SurfaceBoundaryUnify() const;
126 virtual void SetSurfaceBoundaryUnify( bool unify );
127
130
132 virtual void SetSurfaceBoundaryColor( OdCmColor color );
133
134 // SHADING
135
136 virtual OdCmColor CutColor() const;
137 virtual void SetCutColor( OdCmColor color );
138
139 virtual double CutTransparency() const;
140 virtual void SetCutTransparency( double transparencyPercentage );
141
142 virtual OdCmColor SurfaceColor() const;
143 virtual void SetSurfaceColor( OdCmColor color );
144
145 virtual double SurfaceTransparency() const;
146 virtual void SetSurfaceTransparency( double transparencyPercentage );
147
148public:
149 OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
150 void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
151
152 OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
153 void dxfOutFields( OdDbDxfFiler* pFiler ) const override;
154
155 void copyFrom( const OdRxObject* pSource ) override;
156
157protected:
159};
160
161//-------------------------------------------------------------------------------------------------------------------------------------------------------------
162
164{
165public:
167
168 virtual void Appended( CFxBIMMaterial* pM, bool appended, CFxBIMDatabaseReference* pDbRef ) {};
169};
170
171
172//==========================================================================================================================
173//==========================================================================================================================
174//====================================== =========================================================
175//====================================== Enums =========================================================
176//====================================== =========================================================
177//==========================================================================================================================
178//==========================================================================================================================
179
182
183//==========================================================================================================================
184//==========================================================================================================================
185//======================================== ===========================================================
186//======================================== CFxMaterialLayerSet ===========================================================
187//======================================== ===========================================================
188//==========================================================================================================================
189//==========================================================================================================================
190
192{
193 friend class CFxMaterialLayerSetImpl;
194
195public:
197
199
200 bool IsEqual( CFxBIMMaterialPtr p ) const override;
201 bool IsSame( CFxBIMMaterialPtr p ) const override;
202
203 /*
204 Following functions are not needed to be overriden for now:
205 OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
206 void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
207 OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
208 void dxfOutFields( OdDbDxfFiler* pFiler ) const override;*/
209
210 void copyFrom( const OdRxObject* pSource ) override;
211
212protected:
214};
215
217
219{
221 CFxDirectionSenseEnum m_DirectionSense = CFxDirectionSenseEnum::eInvalid;
222 CFxLayerSetDirectionEnum m_LayerSetDirection = CFxLayerSetDirectionEnum::eInvalid;
223
224 //TODO: If material count is more than 9 then this approch of using std::map may
225 // not work as material name sequence will not be correct
226 std::map< OdString, std::pair< OdString, double > > mapLayersInfo;
227};
#define FXBIM_API
Definition: FxBIM.h:20
#define FXBIM_COMMON_CODE_API
Definition: FxBIM.h:21
eAxis1
OdSmartPtr< CFxMaterialLayerSet > CFxMaterialLayerSetPtr
eUnset
enum FXBIM_API CFxLayerSetDirectionEnum
eNegative
eAxis2
ePositive
enum FXBIM_API CFxDirectionSenseEnum
eAxis3
OdSmartPtr< CFxBIMMaterial > CFxBIMMaterialPtr
Definition: FxBIMMaterial.h:29
OdResult
Definition: OdResult.h:29
virtual double CutTransparency() const
virtual void SetSurfaceTransparency(double transparencyPercentage)
virtual bool CutPatternScaleWithViewPort() const
virtual void SetSurfacePatternColor(OdCmColor color)
virtual void SetSurfacePatternRotationRelativeToElementBaseline(bool RotationRelativeToElementBaseline)
virtual OdResult SetName(const OdString &name)
virtual bool IsEqual(CFxBIMMaterialPtr p) const
virtual OdCmColor CutColor() const
virtual OdDb::LineWeight SurfaceBoundaryLineweight() const
virtual void SetCutBoundaryLineweight(OdDb::LineWeight lineweight)
virtual void SetSurfacePatternType(PatternType type)
virtual const OdString & SurfacePatternName() const
virtual bool SurfacePatternRotationRelativeToElementBaseline() const
virtual const OdString & MappedName() const
virtual void SetSurfacePatternRotation(double angle)
virtual void SetCutPatternScaleWithViewPort(bool ScaleWithViewport)
virtual OdDb::LineWeight CutPatternLineweight() const
virtual void SetCutPatternScale(double patternScale)
virtual double SurfacePatternRotation() const
virtual PatternType CutPatternType() const
virtual double SurfacePatternScale() const
virtual double CutPatternScale() const
virtual bool CutBoundaryUnify() const
virtual double CutPatternRotation() const
virtual void SetSurfaceBoundaryColor(OdCmColor color)
virtual void SetCutPatternName(const OdString &patternName)
virtual double SurfaceTransparency() const
virtual bool CutPatternRotationRelativeToElementBaseline() const
virtual void SetCutPatternRotationRelativeToElementBaseline(bool RotationRelativeToElementBaseline)
virtual void SetCutBoundaryUnify(bool unify)
virtual OdString Name() const
OdResult dwgInFields(OdDbDwgFiler *pFiler) override
void dwgOutFields(OdDbDwgFiler *pFiler) const override
virtual MaterialType GetMaterialType()
virtual OdDb::LineWeight SurfacePatternLineweight() const
virtual bool SurfacePatternScaleWithViewPort() const
void dxfOutFields(OdDbDxfFiler *pFiler) const override
virtual void SetCutColor(OdCmColor color)
virtual bool IsSame(CFxBIMMaterialPtr p) const
static OdStringArray PatternList(OdDb::MeasurementValue measurement)
virtual void SetSurfacePatternScaleWithViewPort(bool ScaleWithViewport)
virtual void SetCutPatternColor(OdCmColor color)
virtual OdDb::LineWeight CutBoundaryLineweight() const
virtual void SetCutPatternLineweight(OdDb::LineWeight lineweight)
virtual PatternType SurfacePatternType() const
virtual void SetSurfaceBoundaryLineweight(OdDb::LineWeight lineweight)
virtual void SetCutPatternType(PatternType type)
virtual void SetSurfacePatternLineweight(OdDb::LineWeight lineweight)
virtual void SetCutTransparency(double transparencyPercentage)
virtual bool SurfaceBoundaryUnify() const
virtual OdCmColor CutBoundaryColor() const
virtual void SetSurfacePatternName(const OdString &patternName)
virtual void SetMappedName(const OdString &mappedName)
virtual OdCmColor CutPatternColor() const
OdResult dxfInFields(OdDbDxfFiler *pFiler) override
virtual void SetCutBoundaryColor(OdCmColor color)
ODDB_DECLARE_MEMBERS(CFxBIMMaterial)
virtual OdCmColor SurfacePatternColor() const
virtual OdCmColor SurfaceColor() const
virtual void SetSurfaceColor(OdCmColor color)
virtual void SetSurfacePatternScale(double patternScale)
virtual OdCmColor SurfaceBoundaryColor() const
virtual const OdString & CutPatternName() const
virtual ~CFxBIMMaterial()
virtual void SetCutPatternRotation(double angle)
virtual void SetSurfaceBoundaryUnify(bool unify)
void copyFrom(const OdRxObject *pSource) override
virtual void Appended(CFxBIMMaterial *pM, bool appended, CFxBIMDatabaseReference *pDbRef)
virtual ~CFxBIMMaterialReactor()
bool IsSame(CFxBIMMaterialPtr p) const override
virtual ~CFxMaterialLayerSet()
void copyFrom(const OdRxObject *pSource) override
ODDB_DECLARE_MEMBERS(CFxMaterialLayerSet)
bool IsEqual(CFxBIMMaterialPtr p) const override
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
MeasurementValue
Definition: OdaDefs.h:442
LineWeight
Definition: OdaDefs.h:386
std::map< OdString, std::pair< OdString, double > > mapLayersInfo