CFx SDK Documentation  2020SP3
AveMaterial.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 
24 
25 
26 #ifndef OD_AVEMATERIAL_H
27 #define OD_AVEMATERIAL_H
28 
29 #include "TD_PackPush.h"
30 
31 #include "Ve/AveDefs.h"
32 #include "RxObject.h"
33 #include "DbEntity.h"
34 #include "IdArrays.h"
35 
36 class OdDbObjectId;
37 class OdDbDatabase;
38 class OdAveMaterialImpl;
39 class OdAveMaterial;
44 
56 {
57 public:
59 
70  static OdAveMaterialPtr getMaterial(const OdDbObjectId& blockRefId);
71 
77  static OdString getMaterialName(const OdDbObjectId& blockRefId);
78 
87  OdResult writeMaterial(OdDbDatabase* pDb = NULL, const OdDbHandle& holderHandle = 0);
88 
95  bool attachToObject(OdDbObjectId entityId);
96 
104 
118  bool attachToACI(OdUInt16 colorIndex);
119 
124  static void detachFromObject(OdDbObjectId entityId);
125 
130  static void detachFromLayer(OdDbObjectId layerId);
131 
142  static void detachFromACI(OdDbDatabase* pDb, OdUInt16 colorIndex);
143 
154  static bool getAttachedMaterial(const OdDbObjectId& sourceId, OdDbObjectId& blockRefId);
155 
166  static bool getAttachedMaterial(OdDbDatabase* pDb, OdUInt16 colorIndex, OdDbObjectId& blockRefId);
167 
182  static void getAciMaterialMap(OdDbDatabase* pDb, OdDbObjectIdArray& blockRefIds);
183 
199 
221 
226  OdString name() const;
231 
239  void setName(const OdString& name);
240 
245  void setDescription(const OdString& description);
246 
254  double ambientFactor() const;
255 
268  bool ambientColorCurrent() const;
269 
273  bool ambientLock() const;
274 
280  void setAmbientFactor(double ambientFactor);
281 
287  void setAmbientColor(OdUInt32 ambientColor);
293  void setAmbientColorCurrent(bool currentColor);
298  void setAmbientLock(bool ambientLock);
299 
300 
308  double diffuseFactor() const;
309 
317 
323  bool diffuseColorCurrent() const;
324 
325 
331 
339  void setDiffuseFactor(double diffuseFactor);
345  void setDiffuseColor(OdUInt32 diffuseColor);
346 
353  void setDiffuseColorCurrent(bool currentColor);
354 
362  double specularFactor() const;
363 
377  bool specularColorCurrent() const;
382  bool specularMirror() const;
383 
388  bool specularLock() const;
389 
394  const OdAveBitmap& specularBitmap() const;
395 
396 
403  void setSpecularFactor(double specularFactor);
410  void setSpecularColor(OdUInt32 specularColor);
411 
418  void setSpecularColorCurrent(bool colorCurrrent);
424  void setSpecularMirror(bool mirror);
425 
433  void setSpecularLock(bool specularLock);
434 
444  double roughness() const;
454  void setRoughness(double);
455 
467  double transparency() const;
485  void setTransparency(double transparency);
486 
491  double refraction() const;
492 
499  void setRefraction(double refraction) const;
500 
508  const OdAveBitmap& bumpMap() const;
509 
514 
519 
523  void setHandleDbMaterial(const OdString& sDesc);
524 
526 protected:
528  OdAveMaterial(OdAveMaterialImpl* pImpl);
529 
530  OdAveMaterialImpl* m_pImpl;
531  friend class OdAveMaterialImpl;
532 };
533 
544 {
545 public:
547 
553  {
554  kFirst = 0,
555  kSecond = 1,
556  kThird = 2,
557  kFourth = 3
558  };
559 
561 
584  double colorFactor(GraniteColor graniteColor);
585 
604  OdUInt32 color(GraniteColor graniteColor);
605 
630  void setColorFactor(GraniteColor graniteColor, double colorFactor);
631 
653  void setColor(GraniteColor graniteColor, OdUInt32 color);
654 
667  double sharpness();
680  void setSharpness(double sharpness);
681 
689  double scale();
699  void setScale(double scale);
700 
701 protected:
703  OdAveGraniteMaterial(OdAveMaterialImpl* pImpl);
704 };
709 
720 {
721 public:
723 
725 
740 
746  void stoneColor(OdUInt32 color);
747 
753  void veinColor(OdUInt32 color);
754 
770  void setTurbulence(OdUInt32 turbulence);
771 
784  double sharpness();
796  void setSharpness(double sharpness);
797 
798 
806  double scale();
807 
817  void setScale(double scale);
818 
819 protected:
821  OdAveMarbleMaterial(OdAveMaterialImpl* pImpl);
822 };
823 
828 
837 {
838 public:
840 
842 
859  void setLightColor(OdUInt32 lightColor);
864  void setDarkColor(OdUInt32 darkColor);
865 
878  double lightDark();
889  void setLightDark(double lightDark);
890 
898  double ringDensity();
906  void setRingDensity(double ringDensity);
907 
921  double ringWidth();
934  void setRingWidth(double ringWidth);
935 
948  double ringShape();
961  void setRingShape(double ringShape) ;
962 
970  double scale();
971 
981  void setScale(double scale);
982 
983 protected:
985  OdAveWoodMaterial(OdAveMaterialImpl* pImpl);
986 };
987 
992 
1001 
1003 
1005 
1006 #include "TD_PackPop.h"
1007 
1008 #endif // OD_AVEMATERIAL_H
1009 
OdAveMaterial::ambientColor
OdUInt32 ambientColor() const
OdResult
OdResult
Definition: OdResult.h:29
OdAveWoodMaterial::OdAveWoodMaterial
OdAveWoodMaterial(OdAveMaterialImpl *pImpl)
OdAveWoodMaterial::scale
double scale()
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
NULL
#define NULL
Definition: GsProperties.h:177
OdAveMaterial::getAciMaterialMap
static void getAciMaterialMap(OdDbDatabase *pDb, OdDbObjectIdArray &blockRefIds)
OdAveWoodMaterial::setRingShape
void setRingShape(double ringShape)
OdAveMaterial::transparency
double transparency() const
OdAveWoodMaterial::ringDensity
double ringDensity()
OdAveWoodMaterial::ringShape
double ringShape()
scale
scale
Definition: DimVarDefs.h:1684
name
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdAveMaterial::attachToObject
bool attachToObject(OdDbObjectId entityId)
OdAveMaterial::setDiffuseColor
void setDiffuseColor(OdUInt32 diffuseColor)
IdArrays.h
OdAveMaterial::setSpecularFactor
void setSpecularFactor(double specularFactor)
OdAveWoodMaterial::setDarkColor
void setDarkColor(OdUInt32 darkColor)
OdAveGraniteMaterial::OdAveGraniteMaterial
OdAveGraniteMaterial(OdAveMaterialImpl *pImpl)
OdAveMaterial::writeMaterial
OdResult writeMaterial(OdDbDatabase *pDb=NULL, const OdDbHandle &holderHandle=0)
OdRxObject
Definition: RxObject.h:564
oddbGetMaterialIds
AVE_EXPORT void oddbGetMaterialIds(OdDbDatabase *pDb, OdDbObjectIdArray &ids)
OdDbObjectId
Definition: DbObjectId.h:99
OdAveMaterial::detachFromObject
static void detachFromObject(OdDbObjectId entityId)
OdAveWoodMaterial::setScale
void setScale(double scale)
OdAveGraniteMaterial::type
virtual OdAve::MaterialType type()
OdAveMaterial::getAttachedMaterial
static bool getAttachedMaterial(OdDbDatabase *pDb, OdUInt16 colorIndex, OdDbObjectId &blockRefId)
OdAveMaterial::bumpMap
OdAveBitmap & bumpMap()
OdAveGraniteMaterial::colorFactor
double colorFactor(GraniteColor graniteColor)
OdAveMarbleMaterial::setScale
void setScale(double scale)
OdAveMaterial::name
OdString name() const
OdAveMarbleMaterial::sharpness
double sharpness()
OdAveMaterial
Definition: AveMaterial.h:56
OdAveMaterial::getAttachedMaterial
static bool getAttachedMaterial(const OdDbObjectId &sourceId, OdDbObjectId &blockRefId)
OdAveMaterial::attachToACI
bool attachToACI(OdUInt16 colorIndex)
OdAveGraniteMaterial::setScale
void setScale(double scale)
OdAveMaterial::setSpecularMirror
void setSpecularMirror(bool mirror)
OdArray< OdDbObjectId, OdMemoryAllocator< OdDbObjectId > >
TD_PackPop.h
OdAve::MaterialType
MaterialType
Definition: AveDefs.h:40
OdAveMaterial::specularBitmap
const OdAveBitmap & specularBitmap() const
OdAveGraniteMaterial::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdAveGraniteMaterial)
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
OdAveMaterial::type
virtual OdAve::MaterialType type()
OdAveMarbleMaterial::type
virtual OdAve::MaterialType type()
OdAveMaterial::setDescription
void setDescription(const OdString &description)
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdAveMaterial::diffuseColor
OdUInt32 diffuseColor() const
OdAveMaterial::setHandleDbMaterial
void setHandleDbMaterial(const OdString &sDesc)
OdAveMarbleMaterialPtr
OdSmartPtr< OdAveMarbleMaterial > OdAveMarbleMaterialPtr
Definition: AveMaterial.h:827
OdAveMaterial::setSpecularColorCurrent
void setSpecularColorCurrent(bool colorCurrrent)
OdAveMaterial::bumpMap
const OdAveBitmap & bumpMap() const
OdAveGraniteMaterial::OdAveGraniteMaterial
OdAveGraniteMaterial()
OdAveMaterial::setName
void setName(const OdString &name)
OdAveMaterial::OdAveMaterial
OdAveMaterial(OdAveMaterialImpl *pImpl)
OdAveGraniteMaterial::GraniteColor
GraniteColor
Definition: AveMaterial.h:553
OdAveMaterial::setAmbientColorCurrent
void setAmbientColorCurrent(bool currentColor)
OdAveMaterial::setDiffuseFactor
void setDiffuseFactor(double diffuseFactor)
OdAveGraniteMaterial::setColor
void setColor(GraniteColor graniteColor, OdUInt32 color)
OdAveMaterial::diffuseBitmap
OdAveBitmap & diffuseBitmap() const
OdAve::MaterialAttrib
MaterialAttrib
Definition: AveDefs.h:48
OdAveMaterial::detachFromACI
static void detachFromACI(OdDbDatabase *pDb, OdUInt16 colorIndex)
OdAveWoodMaterialPtr
OdSmartPtr< OdAveWoodMaterial > OdAveWoodMaterialPtr
Definition: AveMaterial.h:991
OdAveMaterial::specularFactor
double specularFactor() const
OdAveMaterial::description
OdString description() const
OdAveWoodMaterial
Definition: AveMaterial.h:837
OdAveMarbleMaterial
Definition: AveMaterial.h:720
OdAveMarbleMaterial::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdAveMarbleMaterial)
OdAveMaterial::refraction
double refraction() const
OdAveWoodMaterial::ringWidth
double ringWidth()
OdSmartPtr
Definition: SmartPtr.h:58
OdAveMaterial::isAttribUsed
bool isAttribUsed(OdAve::MaterialAttrib attributes)
OdAveMaterial::setSpecularColor
void setSpecularColor(OdUInt32 specularColor)
DbEntity.h
AveDefs.h
OdAveMaterial::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdAveMaterial)
OdAveMarbleMaterial::turbulence
OdUInt32 turbulence()
OdAveGraniteMaterial::color
OdUInt32 color(GraniteColor graniteColor)
OdAveGraniteMaterialPtr
OdSmartPtr< OdAveGraniteMaterial > OdAveGraniteMaterialPtr
Definition: AveMaterial.h:708
OdAveMaterial::m_pImpl
OdAveMaterialImpl * m_pImpl
Definition: AveMaterial.h:530
OdAveGraniteMaterial
Definition: AveMaterial.h:544
OdAveMaterial::~OdAveMaterial
~OdAveMaterial()
OdAveMarbleMaterial::stoneColor
void stoneColor(OdUInt32 color)
OdAveMarbleMaterial::OdAveMarbleMaterial
OdAveMarbleMaterial(OdAveMaterialImpl *pImpl)
OdAveMarbleMaterial::OdAveMarbleMaterial
OdAveMarbleMaterial()
OdAveWoodMaterial::setRingWidth
void setRingWidth(double ringWidth)
OdAveWoodMaterial::setLightDark
void setLightDark(double lightDark)
OdAveGraniteMaterial::scale
double scale()
OdAveWoodMaterial::lightDark
double lightDark()
OdAveMaterial::setAmbientColor
void setAmbientColor(OdUInt32 ambientColor)
OdAveWoodMaterial::lightColor
OdUInt32 lightColor()
OdAveBitmap
Definition: AveDefs.h:148
OdAveMaterial::ambientColorCurrent
bool ambientColorCurrent() const
OdAveMaterial::specularColorCurrent
bool specularColorCurrent() const
OdAveMaterial::handleDbMaterial
OdString handleDbMaterial() const
TD_PackPush.h
OdAveMaterial::specularColor
OdUInt32 specularColor() const
OdAveMaterial::holderId
OdDbObjectId holderId() const
OdAveWoodMaterial::darkColor
OdUInt32 darkColor()
OdAveGraniteMaterial::sharpness
double sharpness()
OdAveMaterial::setTransparency
void setTransparency(double transparency)
OdAveMarbleMaterial::scale
double scale()
OdAveMarbleMaterial::stoneColor
OdUInt32 stoneColor()
OdAveMaterial::getMaterial
static OdAveMaterialPtr getMaterial(const OdDbObjectId &blockRefId)
OdAveWoodMaterial::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdAveWoodMaterial)
OdStreamBuf
Definition: OdStreamBuf.h:67
OdAveMaterial::diffuseColorCurrent
bool diffuseColorCurrent() const
OdDbHandle
Definition: DbHandle.h:67
OdAveMaterial::roughness
double roughness() const
OdAveMaterial::setSpecularLock
void setSpecularLock(bool specularLock)
OdAveMaterial::specularMirror
bool specularMirror() const
OdAveWoodMaterial::type
virtual OdAve::MaterialType type()
OdAveWoodMaterial::OdAveWoodMaterial
OdAveWoodMaterial()
OdAveWoodMaterial::setLightColor
void setLightColor(OdUInt32 lightColor)
OdAveMaterial::setRoughness
void setRoughness(double)
OdAveMaterial::setDiffuseColorCurrent
void setDiffuseColorCurrent(bool currentColor)
OdAveMarbleMaterial::setTurbulence
void setTurbulence(OdUInt32 turbulence)
OdAveMaterial::diffuseFactor
double diffuseFactor() const
OdAveMaterialPtr
OdSmartPtr< OdAveMaterial > OdAveMaterialPtr
Definition: AveMaterial.h:39
OdAveMaterial::ambientFactor
double ambientFactor() const
OdAveMaterial::transparencyBitmap
OdAveBitmap & transparencyBitmap() const
OdAveMaterial::specularLock
bool specularLock() const
OdAveMaterial::detachFromLayer
static void detachFromLayer(OdDbObjectId layerId)
OdAveMarbleMaterial::veinColor
OdUInt32 veinColor()
oddbGetMaterials
AVE_EXPORT OdRxIteratorPtr oddbGetMaterials(OdDbDatabase *pDb)
AVE_EXPORT
#define AVE_EXPORT
Definition: AveExport.h:37
OdAveMaterial::setRefraction
void setRefraction(double refraction) const
OdAveMaterial::specularBitmap
OdAveBitmap & specularBitmap()
OdAveMaterial::attachToLayer
bool attachToLayer(OdDbObjectId layerId)
OdAveMaterial::setAmbientLock
void setAmbientLock(bool ambientLock)
OdAveMaterial::ambientLock
bool ambientLock() const
OdAveMarbleMaterial::veinColor
void veinColor(OdUInt32 color)
OdAveMaterial::getMaterialName
static OdString getMaterialName(const OdDbObjectId &blockRefId)
OdAveMaterial::OdAveMaterial
OdAveMaterial()
OdAveGraniteMaterial::setSharpness
void setSharpness(double sharpness)
OdAveMaterial::setAmbientFactor
void setAmbientFactor(double ambientFactor)
OdAveWoodMaterial::setRingDensity
void setRingDensity(double ringDensity)
OdAveGraniteMaterial::setColorFactor
void setColorFactor(GraniteColor graniteColor, double colorFactor)
OdAveMarbleMaterial::setSharpness
void setSharpness(double sharpness)