CFx SDK Documentation  2023 SP0
GiVisualStyle.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 #ifndef __ODGIVISUALSTYLE_H__
25 #define __ODGIVISUALSTYLE_H__
26 
27 #include "TD_PackPush.h"
28 
29 #include "Gi/Gi.h"
30 #include "Gi/GiVariant.h"
31 
32 class OdCmColorBase;
33 
41 {
42 public:
44 
49  {
50  kInvisible = 0, // Faces are invisible.
51  kConstant = 1, // Faces are drawn in a constant color.
52  kPhong = 2, // Faces are drawn with Phong model to approximate realistic direct lighting.
53  kGooch = 3 // Faces are drawn with non-photorealistic lighting model for automatic technical illustration.
54  };
55 
60  {
61  kNoLighting = 0, // No lighting calculations are applied to the faces.
62  kPerFaceLighting = 1, // Color is calculated for each face based on its orientation to the light sources of the scene.
63  kPerVertexLighting = 2, // Color is calculated for each vertex of a face based on its orientation to the light sources of the scene.
64  kPerPixelLighting = 3 // Color is calculated for each pixel of a face based on its orientation to the light sources of the scene.
65  };
66 
71  {
72  kNoColorMode = 0, // Apply no modifications to the faces.
73  kObjectColor = 1, // Apply the color of the drawable object to the faces of the object.
74  kBackgroundColor = 2, // Apply the display background color to the faces.
75  kMono = 3, // All faces are treated as having a specific color, resulting in a "monochromatic" effect.
76  kTint = 4, // All faces have the hue and saturation values of their color mapped to the hue and saturation values of a specific color, resulting in a "tinted" effect. The luminance value remains unchanged.
77  kDesaturate = 5 // Apply a desaturation percentage to the diffuse color of a material.
78  };
79 
84  {
85  kNoFaceModifiers = 0, // Apply no face modifiers to the faces.
86  kOpacity = 1, // Apply an opacity value to the faces. If unset, faces are displayed with full opacity. If set, faces are displayed with a specified degree of opacity from completely opaque to completely transparent.
87  kSpecular = 2 // Apply a specular highlight (indicating reflection and shininess values) to a material that is applied to the faces.
88  };
89 
95  void set(const OdGiFaceStyle& style);
96 
98  bool operator==(const OdGiFaceStyle& style) const;
99 
105  virtual void setLightingModel(LightingModel lightingModel) = 0;
106 
110  virtual LightingModel lightingModel() const = 0;
111 
117  virtual void setLightingQuality(LightingQuality lightingQuality) = 0;
118 
122  virtual LightingQuality lightingQuality() const = 0;
123 
129  virtual void setFaceColorMode(FaceColorMode mode) = 0;
130 
134  virtual FaceColorMode faceColorMode() const = 0;
135 
141  virtual void setFaceModifiers(unsigned long nModifiers) = 0;
142 
149  virtual void setFaceModifierFlag(FaceModifier flag, bool bEnable) = 0;
150 
154  virtual unsigned long faceModifiers() const = 0;
155 
161  virtual bool isFaceModifierFlagSet(FaceModifier flag) const = 0;
162 
169  virtual void setOpacityLevel(double nLevel, bool bEnableModifier) = 0;
170 
174  virtual double opacityLevel() const = 0;
175 
182  virtual void setSpecularAmount(double nAmount, bool bEnableModifier) = 0;
183 
187  virtual double specularAmount() const = 0;
188 
195  virtual void setMonoColor(const OdCmColorBase& color, bool bEnableMode) = 0;
196 
200  virtual const OdCmColorBase& monoColor() const = 0;
201 
205  virtual OdCmColorBase& monoColor() = 0;
206 };
207 
212 
220 {
221 public:
223 
228  {
229  kNoEdges = 0, // No edges are displayed.
230  kIsolines = 1, // Display isolines.
231  kFacetEdges = 2 // Display facet edges (the edges between neighbouring faces).
232  };
233 
238  {
239  kNoEdgeStyle = 0, // No edge styles are applied to the edges.
240  kVisible = 1, // Visible edges are displayed.
241  kSilhouette = 2, // Silhouette edges are displayed.
242  kObscured = 4, // Obscured edges are displayed.
243  kIntersection = 8 // Intersection edges are displayed.
244  };
245 
250  {
251  kNoEdgeModifiers = 0x000, // No modifiers are applied.
252  kOverhang = 0x001, // Allow an edge to overhang its start and end points by a specified amount.
253  kJitter = 0x002, // Apply a jitter effect to the edges. The jitter effect is produced by drawing extra lines adjacent to the original line, with a specific amount of perturbation away from the original line.
254  kWidth = 0x004, // Apply a width to the edges.
255  kColor = 0x008, // Apply a color that differs from the drawable object color to the edges.
256  kHaloGap = 0x010, // Apply a halo gap percentage to the edges of an object that is hidden by another object, such that the specified gap is displayed between the edges of the hidden object and the edges of the object which hides it.
257  kLinetype = 0x020, // Apply a linetype to the edges.
258  kAlwaysOnTop = 0x040, // Force edges to be on top. Edges will not participate in the Z-ordering of the displayed drawables.
259  kOpacity = 0x080, // Apply an opacity value to the edges. If unset, edges are displayed with full opacity. If set, edges are displayed with a specified degree of opacity from completely opaque to completely transparent.
260  kWiggle = 0x100, // Apply a wiggle value to the edges.
261  kTexture = 0x200 // Apply a material texture to the edges.
262  };
263 
268  {
269  kJitterLow = 1, // A small amount of perturbation.
270  kJitterMedium = 2, // A medium amount of perturbation.
271  kJitterHigh = 3 // A large amount of perturbation.
272  };
273 
278  {
279  kWiggleLow = 1, // A small amount of perturbation.
280  kWiggleMedium = 2, // A medium amount of perturbation.
281  kWiggleHigh = 3 // A large amount of perturbation.
282  };
283 
287  enum LineType
288  {
289  kSolid = 1, // A solid line pattern is used to display edges.
290  kDashed = 2, // A dashed line pattern is used to display edges.
291  kDotted = 3, // A dotted line pattern is used to display edges.
292  kShortDash = 4, // A short dashed line pattern is used to display edges.
293  kMediumDash = 5, // A medium dashed line pattern is used to display edges.
294  kLongDash = 6, // A long dashed line pattern is used to display edges.
295  kDoubleShortDash = 7, // A double short dashed line pattern is used to display edges.
296  kDoubleMediumDash = 8, // A double medium dashed line pattern is used to display edges.
297  kDoubleLongDash = 9, // A double long dashed line pattern is used to display edges.
298  kMediumLongDash = 10, // A medium long dashed line pattern is used to display edges.
299  kSparseDot = 11 // A sparse dotted line pattern is used to display edges.
300  };
301 
306  {
307  kDefault, // Apply the edge style to the geometry as designed.
308  kAll // Apply the edge style to all geometry.
309  };
310 
316  void set(const OdGiEdgeStyle& style);
318  bool operator==(const OdGiEdgeStyle& style) const;
319 
325  virtual void setEdgeModel(EdgeModel model) = 0;
326 
330  virtual EdgeModel edgeModel() const = 0;
331 
337  virtual void setEdgeStyles(unsigned long nStyles) = 0;
338 
345  virtual void setEdgeStyleFlag(EdgeStyle flag, bool bEnable) = 0;
346 
350  virtual unsigned long edgeStyles() const = 0;
351 
357  virtual bool isEdgeStyleFlagSet(EdgeStyle flag) const = 0;
358 
364  virtual void setIntersectionColor(const OdCmColorBase& color) = 0;
365 
369  virtual const OdCmColorBase& intersectionColor() const = 0;
370 
375 
381  virtual void setObscuredColor(const OdCmColorBase& color) = 0;
382 
386  virtual const OdCmColorBase& obscuredColor() const = 0;
387 
391  virtual OdCmColorBase& obscuredColor() = 0;
392 
398  virtual void setObscuredLinetype(LineType ltype) = 0;
399 
403  virtual LineType obscuredLinetype() const = 0;
404 
411 
415  virtual LineType intersectionLinetype() const = 0;
416 
422  virtual void setCreaseAngle(double nAngle) = 0;
423 
427  virtual double creaseAngle() const = 0;
428 
434  virtual void setEdgeModifiers(unsigned long nModifiers) = 0;
435 
442  virtual void setEdgeModifierFlag(EdgeModifier flag, bool bEnable) = 0;
443 
447  virtual unsigned long edgeModifiers() const = 0;
448 
454  virtual bool isEdgeModifierFlagSet(EdgeModifier flag) const = 0;
455 
462  virtual void setEdgeColor(const OdCmColorBase& color, bool bEnableModifier) = 0;
463 
467  virtual const OdCmColorBase& edgeColor() const = 0;
468 
472  virtual OdCmColorBase& edgeColor() = 0;
473 
480  virtual void setOpacityLevel(double nLevel, bool bEnableModifier) = 0;
481 
485  virtual double opacityLevel() const = 0;
486 
493  virtual void setEdgeWidth(int nWidth, bool bEnableModifier) = 0;
494 
498  virtual int edgeWidth() const = 0;
499 
506  virtual void setOverhangAmount(int nAmount, bool bEnableModifier) = 0;
507 
511  virtual int overhangAmount() const = 0;
512 
519  virtual void setJitterAmount(JitterAmount amount, bool bEnableModifier) = 0;
520 
524  virtual JitterAmount jitterAmount() const = 0;
525 
532  virtual void setWiggleAmount(WiggleAmount amount, bool bEnableModifier) = 0;
533 
537  virtual WiggleAmount wiggleAmount() const = 0;
538 
544  virtual void setSilhouetteColor(const OdCmColorBase& color) = 0;
545 
549  virtual const OdCmColorBase& silhouetteColor() const = 0;
550 
555 
561  virtual void setSilhouetteWidth(short nWidth) = 0;
562 
566  virtual short silhouetteWidth() const = 0;
567 
574  virtual void setHaloGap(int nHaloGap, bool bEnableModifier) = 0;
575 
579  virtual int haloGap() const = 0;
580 
586  virtual void setIsolines(unsigned short nIsolines) = 0;
587 
591  virtual unsigned short isolines() const = 0;
592 
598  virtual void setHidePrecision(bool bHidePrecision) = 0;
599 
603  virtual bool hidePrecision() const = 0;
604 
610  virtual void setEdgeStyleApply(EdgeStyleApply apply) = 0;
611 
615  virtual EdgeStyleApply edgeStyleApply() const = 0;
616 };
617 
622 
630 {
631 public:
633 
638  {
639  kNone = 0x00, // No display settings are used.
640  kBackgrounds = 0x01, // Backgrounds are enabled.
641  kLights = 0x02, // Lights are enabled.
642  kMaterials = 0x04, // Materials are enabled.
643  kTextures = 0x08 // Textures are enabled.
644  };
645 
650  {
651  kShadowsNone = 0, // No shadow is displayed.
652  kShadowsGroundPlane = 1, // Ground plane shadows are displayed.
653  kShadowsFull = 2, // Full shadows are displayed.
654  kShadowsFullAndGround = 3 // Full shadows are displayed along with shadows on the ground plane.
655  };
656 
662  void set(const OdGiDisplayStyle& style);
664  bool operator==(const OdGiDisplayStyle& style) const;
665 
671  virtual void setDisplaySettings(unsigned long nSettings) = 0;
672 
679  virtual void setDisplaySettingsFlag(DisplaySettings flag, bool bEnable) = 0;
680 
684  virtual unsigned long displaySettings() const = 0;
685 
691  virtual bool isDisplaySettingsFlagSet(DisplaySettings flag) const = 0;
692 
698  virtual void setBrightness(double value) = 0;
699 
703  virtual double brightness() const = 0;
704 
710  virtual void setShadowType(ShadowType type) = 0;
711 
715  virtual ShadowType shadowType() const = 0;
716 };
717 
722 
723 
729 {
733  enum Property
734  {
735  kInvalidProperty = -1, // Invalid property.
736 
737  // Face properties
738 
739  kFaceLightingModel = 0, // The lighting model applied to the faces of drawables. See the FaceLightingModel enumeration.
740  kFaceLightingQuality = 1, // The calculation method of lighting effects applied to faces. See the FaceLightingQuality enumeration.
741  kFaceColorMode = 2, // The color mode applied to faces. See the FaceColorMode enumeration.
742  kFaceModifiers = 3, // Modifications applied to faces. See the FaceModifiers enumeration.
743  kFaceOpacity = 4, // The face opacity property. Double value representing the face opacity level in the range from 0.0 (faces are fully transparent) to 1.0 (no transparency).
744  kFaceSpecular = 5, // The face specular property. Double value representing the specular highlight amount (indicating reflection and shininess values) of the material that is applied to faces.
745  kFaceMonoColor = 6, // The face monocolor effect property. OdCmColor representing the color applied to produce a "monochromatic" effect on faces.
746 
747  // Edge properties
748 
749  kEdgeModel = 7, // The edge model property. See the EdgeModel enumeration.
750  kEdgeStyles = 8, // The edge style property. See the EdgeStyles enumeration.
751  kEdgeIntersectionColor = 9, // The intersected edges color. OdCmColor representing the color applied to intersection edges.
752  kEdgeObscuredColor = 10, // The obscured edges color. OdCmColor representing the color applied to obscured edges.
753  kEdgeObscuredLinePattern = 11, // The line pattern applied to obscured edges. See the EdgeLinePattern enumeration.
754  kEdgeIntersectionLinePattern = 12, // The line pattern applied to intersection edges. See the EdgeLinePattern enumeration.
755  kEdgeCreaseAngle = 13, // The edge crease angle. Double value indicating angle threshold, above which a facet edge representing adjoining facets will be displayed.
756  kEdgeModifiers = 14, // Modifications applied to edges. See the EdgeModifiers enumeration.
757  kEdgeColor = 15, // The edge color property. OdCmColor representing the color applied to edges.
758  kEdgeOpacity = 16, // The edge opacity property. Double value representing the edge opacity level in the range from 0.0 (faces are fully transparent) to 1.0 (no transparency).
759  kEdgeWidth = 17, // The edge width property. Integer value representing edge width in pixels.
760  kEdgeOverhang = 18, // The edge overhang property. Integer value representing the amount, in pixels, that edges should overhang their start and end points.
761  kEdgeJitterAmount = 19, // The edge jitter amount. See the EdgeJitterAmount enum.
762  kEdgeSilhouetteColor = 20, // The edge silhouette color property. OdCmColor enumeration the color applied to silhouette edges.
763  kEdgeSilhouetteWidth = 21, // The edge silhouette width property. Short value representing silhouette edge width in pixels.
764  kEdgeHaloGap = 22, // The edge halo gap amount. Integer value from 0 to 100 representing the halo gap.
765  kEdgeIsolines = 23, // The isolines number property. Unsigned short value, between 0 and 2047, indicating the number of isolines to display for curved surfaces.
766  kEdgeHidePrecision = 24, // The hide precision property. Boolean value indicating hide precision enabled. True if enabled; otherwise, false.
767 
768  // Display properties
769 
770  kDisplayStyles = 25, // Display settings. See the DisplayStyles enumeration.
771  kDisplayBrightness = 26, // The display brightness property. Double value indicating brightness.
772  kDisplayShadowType = 27, // The display shadow type property. See the DisplayShadowType enumeration.
773 
774  // New in AC2011, 2013
775  kUseDrawOrder = 28, // Boolean value indicating whether draw order is enabled. True if enabled; otherwise, false.
776  kViewportTransparency = 29, // Boolean value indicating whether viewport transparency is enabled. True if enabled; otherwise, false.
777  kLightingEnabled = 30, // Boolean value indicating whether lightning is enabled. True if enabled; otherwise, false.
778  kPosterizeEffect = 31, // Boolean value indicating whether posterize effect is enabled. True if enabled; otherwise, false.
779  kMonoEffect = 32, // Boolean value indicating whether mono effect is enabled. True if enabled; otherwise, false.
780 
781  // New in 2013
782  kBlurEffect = 33, // Boolean value indicating whether blur effect is enabled. True if enabled; otherwise, false.
783  kPencilEffect = 34, // Boolean value indicating whether pencil effect is enabled. True if enabled; otherwise, false.
784  kBloomEffect = 35, // Boolean value indicating whether bloom effect is enabled. True if enabled; otherwise, false.
785  kPastelEffect = 36, // Boolean value indicating whether pastel effect is enabled. True if enabled; otherwise, false.
786  kBlurAmount = 37, // The blur amount property. Integer value representing amount of blur effect.
787  kPencilAngle = 38, // The pencil angle amount property. Double value representing the angle amount.
788  kPencilScale = 39, // The pencil scale amount property. Double value representing the scale amount.
789  kPencilPattern = 40, // The pencil pattern amount property. Integer value representing the pencil pattern.
790  kPencilColor = 41, // The pencil color property. OdCmColor representing the pencil color.
791  kBloomThreshold = 42, // The bloom effect threshold property. Integer value representing the threshold value.
792  kBloomRadius = 43, // The bloom effect radius. Integer value representing the bloom radius.
793  kTintColor = 44, // The tint color property. OdCmColor representing the color used for tint effect.
794  kFaceAdjustment = 45, // Boolean value indicating face adjustment enabled. True if enabled; otherwise, false.
795  kPostContrast = 46, // The post-processing contrast property. Integer value representing the contrast value.
796  kPostBrightness = 47, // The post-processing brightness property. Integer value representing the brightness value.
797  kPostPower = 48, // Integer value.
798  kTintEffect = 49, // Boolean value indicating tint effect enabled. True if enabled; otherwise, false.
799  kBloomIntensity = 50, // The bloom intensity property. Integer value representing the intensity of the bloom effect.
800  kColor = 51, // OdCmColor value.
801  kTransparency = 52, // Double value.
802  kEdgeWiggleAmount = 53, // The edge wiggle amount property. See the WiggleAmount enumeration.
803  kEdgeTexturePath = 54, // The edge texture path property. String value representing the path to texture.
804  kDepthOfField = 55, // Boolean value indicating depth of field effect enabled. True if enabled; otherwise, false.
805  kFocusDistance = 56, // The focus distance property. Double value indicating the focus distance value.
806  kFocusWidth = 57, // The focus width property. Double value indicating the focus width value.
807 
808  kPropertyCount // The number of visual style properties.
809  };
810 
811  //
812  // Face properties
813  //
818  {
819  kInvisible = 0, // Faces are invisible.
820  kConstant = 1, // Faces are drawn in a constant color.
821  kPhong = 2, // Faces are drawn with Phong model to approximate realistic direct lighting.
822  kGooch = 3, // Faces are drawn with non-photorealistic lighting model for automatic technical illustration.
823  // New in 2011
824  kZebra = 4
825  };
826 
831  {
832  kNoLighting = 0, // No lighting calculations are applied to the faces.
833  kPerFaceLighting = 1, // Color is calculated for each face based on its orientation to the light sources of the scene.
834  kPerVertexLighting = 2, // Color is calculated for each vertex of a face based on its orientation to the light sources of the scene.
835  kPerPixelLighting = 3 // Color is calculated for each pixel of a face based on its orientation to the light sources of the scene.
836  };
837 
843  {
844  kNoColorMode = 0, // Apply no modifications to the faces.
845  kObjectColor = 1, // Apply the color of the drawable object to the faces of the object.
846  kBackgroundColor = 2, // Apply the display background color to the faces.
847  kMono = 3, // All faces are treated as having a specific color, resulting in a "monochromatic" effect.
848  kTint = 4, // All faces have the hue and saturation values of their colors mapped to the hue and saturation values of a specific color, resulting in a "tinted" effect. The luminance value remains unchanged.
849  kDesaturate = 5 // Apply a desaturation percentage to the diffuse color of a material.
850  };
851 
857  {
858  kNoFaceModifiers = 0, // Apply no face modifiers to the faces.
859  kFaceOpacityFlag = 1, // Apply an opacity value to the faces. If unset, faces are displayed with full opacity. If set, faces are displayed with a specified degree of opacity from completely opaque to completely transparent.
860  kSpecularFlag = 2 // Apply a specular highlight (indicating reflection and shininess values) to a material that is applied to the faces.
861  };
862 
863  //
864  // Edge properties
865  //
866 
870  enum EdgeModel
871  {
872  kNoEdges = 0, // No edges are displayed.
873  kIsolines = 1, // Display isolines.
874  kFacetEdges = 2 // Display facet edges (the edges between neighbouring faces).
875  };
876 
881  {
882  kNoEdgeStyle = 0, // No edge styles are applied to the edges.
883  kVisibleFlag = 1, // Visible edges are displayed.
884  kSilhouetteFlag = 2, // Silhouette edges are displayed. A silhouette edge is an edge connecting a back facing polygon with a front facing polygon.
885  kObscuredFlag = 4, // Obscured edges are displayed.
886  kIntersectionFlag = 8 // Intersection edges are displayed.
887  };
888 
893  {
894  kNoEdgeModifiers = 0, // No modifiers are applied.
895  kEdgeOverhangFlag = 1, // Allow an edge to overhang its start and end points by a specified amount.
896  kEdgeJitterFlag = 2, // Apply a jitter effect to the edges. The jitter effect is produced by drawing extra lines adjacent to the original line, with a specific amount of perturbation away from the original line.
897  kEdgeWidthFlag = 4, // Apply a width to the edges.
898  kEdgeColorFlag = 8, // Apply a color that differs from the drawable object color to the edges.
899  kEdgeHaloGapFlag = 16, // Apply a halo gap percentage to the edges of an object that is hidden by another object, such that the specified gap is displayed between the edges of the hidden object and the edges of the object which hides it.
900  kAlwaysOnTopFlag = 64, // Force edges to be on top. Edges will not participate in the Z-ordering of the displayed drawables.
901  kEdgeOpacityFlag = 128, // Apply an opacity value to the edges. If unset, edges are displayed with full opacity. If set, edges are displayed with a specified degree of opacity from completely opaque to completely transparent.
902  // New in 2013
903  kEdgeWiggleFlag = 256, // Apply a wiggle value to the edges.
904  kEdgeTextureFlag = 512 // Apply a material textures to the edges.
905  };
906 
911  {
912  kJitterLow = 1, // A small amount of perturbation.
913  kJitterMedium = 2, // A medium amount of perturbation.
914  kJitterHigh = 3 // A large amount of perturbation.
915  };
916 
921  {
922  kWiggleLow = 1, // A small amount of perturbation.
923  kWiggleMedium = 2, // A medium amount of perturbation.
924  kWiggleHigh = 3 // A large amount of perturbation.
925  };
926 
931  {
932  kSolid = 1, // A solid line pattern is used to display edges.
933  kDashedLine = 2, // A dashed line pattern is used to display edges.
934  kDotted = 3, // A dotted line pattern is used to display edges.
935  kShortDash = 4, // A short dashed line pattern is used to display edges.
936  kMediumDash = 5, // A medium dashed line pattern is used to display edges.
937  kLongDash = 6, // A long dashed line pattern is used to display edges.
938  kDoubleShortDash = 7, // A double short dashed line pattern is used to display edges.
939  kDoubleMediumDash = 8, // A double medium dashed line pattern is used to display edges.
940  kDoubleLongDash = 9, // A double long dashed line pattern is used to display edges.
941  kMediumLongDash = 10, // A medium long dashed line pattern is used to display edges.
942  kSparseDot = 11 // A sparse dotted line pattern is used to display edges.
943  };
944 
945  //
946  // Display properties
947  //
952  {
953  kNoDisplayStyle = 0, // No display settings are used.
954  kBackgroundsFlag = 1, // Backgrounds are enabled.
955  kLightingFlag = 2, // Lights are enabled.
956  kMaterialsFlag = 4, // Materials are enabled.
957  kTexturesFlag = 8 // Textures are enabled.
958  };
959 
964  {
965  kShadowsNone = 0, // No shadow is displayed.
966  kShadowsGroundPlane = 1, // Ground plane shadows are displayed.
967  kShadowsFull = 2, // Full shadows are displayed.
968  kShadowsFullAndGround = 3 // Full shadows are displayed along with shadows on the ground plane.
969  };
970 };
971 
978 {
980  {
981  kInvalidOperation = -1, // Invalid operation.
982  kInherit = 0, // Use the last property value specified.
983  kSet = 1, // Replace the last property value with the one specified.
984  kDisable = 2, // Disable the specified bits in the property bitmask.
985  kEnable = 3 // Enable the specified bits in the property bitmask.
986  };
987 };
988 
996 {
997 public:
999 
1003  enum Type
1004  {
1005  kFlat, // Flat shaded visual style.
1006  kFlatWithEdges, // Flat shaded visual style with edges displayed.
1007  kGouraud, // Gouraud shaded visual style.
1008  kGouraudWithEdges, // Gouraud shaded visual style with edges displayed.
1009  k2DWireframe, // 2D wireframe visual style (using 2D graphics system).
1010  k3DWireframe, // 3D wireframe visual style (using 3D graphics system).
1011  kHidden, // Hidden visual style.
1012  kBasic, // Basic visual style (default).
1013  kRealistic, // Phong shaded visual style.
1014  kConceptual, // Custom, user defined visual visual style.
1015  kCustom, // Custom, user defined visual visual style.
1016  kDim, // Visual style used for a dimming effect.
1017  kBrighten, // Visual style used for a brightening effect.
1018  kThicken, // Visual style used for a thickening effect.
1019  kLinePattern, // Visual style used to apply a line pattern.
1020  kFacePattern, // Visual style used to apply a face pattern.
1021  kColorChange, // Visual style used to apply a change of color.
1022 
1023  kFaceOnly, // Visual style with only face properties. All non-face properties are set to inherit.
1024  kEdgeOnly, // Visual stle with edge properties only. All non-edge properties are set to inherit.
1025  kDisplayOnly, // Visual style with display properties only. All non-display properties are set to inherit.
1026 
1027  kJitterOff, // Edge style override visual style with jitter edges off. All other properties are set to inherit.
1028  kOverhangOff, // Edge style override visual style with overhang edges off. All other properties are set to inherit.
1029  kEdgeColorOff, // Edge style override visual style with edge color off. All other properties are set to inherit.
1030  kShadesOfGray, // Shades of gray visual style.
1031  kSketchy, // Sketchy visual style.
1032  kXRay, // Xray visual style.
1033  kShadedWithEdges, // Shade visual style with edges displayed.
1034  kShaded, // Shaded visual style.
1035  kByViewport, // Visual style by viewport.
1036  kByLayer, // Visual style by layer.
1037  kByBlock, // Visual style by block.
1038  kEmptyStyle // Visual style with all properties set to inherit. This effectively creates an empty style upon which a custom visual style can be built.
1039  };
1040 
1042  bool operator==(const OdGiVisualStyle& visualStyle) const;
1043 
1047  virtual OdGiFaceStyle& faceStyle (void) = 0;
1051  virtual OdGiEdgeStyle& edgeStyle (void) = 0;
1055  virtual OdGiDisplayStyle& displayStyle (void) = 0;
1056 
1060  virtual const OdGiFaceStyle& faceStyle (void) const = 0;
1064  virtual const OdGiEdgeStyle& edgeStyle (void) const = 0;
1068  virtual const OdGiDisplayStyle& displayStyle (void) const = 0;
1069 
1074  virtual void setFaceStyle (const OdGiFaceStyle& style) = 0;
1079  virtual void setEdgeStyle (const OdGiEdgeStyle& style) = 0;
1084  virtual void setDisplayStyle (const OdGiDisplayStyle& style) = 0;
1085 
1093 
1094  // New interface
1095 
1104  virtual bool setType(Type type) = 0;
1105 
1109  virtual Type type() const = 0;
1110 
1113 
1123  virtual bool setTrait(Property prop, Operation op) = 0;
1124 
1135  virtual bool setTrait(Property prop, const OdGiVariant *pVal,
1137 
1148  virtual bool setTrait(Property prop, OdInt32 nVal,
1150 
1161  virtual bool setTrait(Property prop, bool bVal,
1163 
1174  virtual bool setTrait(Property prop, double dVal,
1176 
1189  virtual bool setTrait(Property prop, double red, double green, double blue,
1201  virtual bool setTrait(Property prop, const OdCmColorBase &pColor,
1203 
1214  virtual bool setTrait(Property prop, const OdCmEntityColor &pColor,
1216 
1227  virtual bool setTrait(Property prop, const OdString &pStr,
1229 
1239  virtual OdGiVariantPtr trait(Property prop, Operation *pOp = NULL) const = 0;
1240 
1249  virtual Operation operation(Property prop) const = 0;
1250 
1251 
1262  virtual bool setTraitFlag(Property flagProp, OdUInt32 flagVal, bool bEnable = true);
1263 
1273  virtual bool traitFlag(Property flagProp, OdUInt32 flagVal) const;
1274 
1281 private:
1282  void configureForFlat();
1283  void configureForFlatWithEdges();
1284  void configureForGouraud();
1285  void configureForGouraudWithEdges();
1286  void configureForBasic();
1287  void configureFor2DWireframe();
1288  void configureFor3DWireframe();
1289  void configureForHidden();
1290  void configureForRealistic();
1291  void configureForConceptual();
1292  void configureForDim();
1293  void configureForBrighten();
1294  void configureForThicken();
1295  void configureForLinePattern();
1296  void configureForFacePattern();
1297  void configureForColorChange();
1298 
1299  // Extended configurations
1300  void configureForFaceOnly();
1301  void configureForEdgeOnly();
1302  void configureForDisplayOnly();
1303 
1304  void configureForJitterOff();
1305  void configureForOverhangOff();
1306  void configureForEdgeColorOff();
1307  void configureForShadesOfGray();
1308  void configureForSketchy();
1309  void configureForXRay();
1310  void configureForShadedWithEdges();
1311  void configureForShaded();
1312  void configureForByViewport();
1313  void configureForByLayer();
1314  void configureForByBlock();
1315  void configureForEmptyStyle();
1316 
1317  // Extended flags configuration
1318  void configureForAc27(bool b2d = false);
1319 
1320  // Clear all changes which is made before
1321  void configureForInit();
1322 };
1323 
1328 
1335 {
1336 public:
1338 
1339  virtual void setOdGiVisualStyle(const OdGiVisualStyle& visualStyle) = 0;
1340  virtual const OdGiVisualStyle& odgiVisualStyle() const = 0;
1341 };
1342 
1347 
1348 #include "TD_PackPop.h"
1349 
1350 #endif //__ODGIVISUALSTYLE_H__
@ kInvisible
Definition: BrEnums.h:115
@ kVisible
Definition: BrEnums.h:114
@ kSolid
Definition: BrepBuilder.h:39
ltype
Definition: DimVarDefs.h:2949
OdSmartPtr< OdGiEdgeStyle > OdGiEdgeStylePtr
OdSmartPtr< OdGiFaceStyle > OdGiFaceStylePtr
OdSmartPtr< OdGiVisualStyleTraits > OdGiVisualStyleTraitsPtr
OdSmartPtr< OdGiVisualStyle > OdGiVisualStylePtr
OdSmartPtr< OdGiDisplayStyle > OdGiDisplayStylePtr
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
int OdInt32
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
virtual void setShadowType(ShadowType type)=0
virtual void setDisplaySettings(unsigned long nSettings)=0
virtual ShadowType shadowType() const =0
OdGiDisplayStyle & operator=(const OdGiDisplayStyle &style)
virtual void setDisplaySettingsFlag(DisplaySettings flag, bool bEnable)=0
virtual unsigned long displaySettings() const =0
virtual double brightness() const =0
virtual bool isDisplaySettingsFlagSet(DisplaySettings flag) const =0
virtual void setBrightness(double value)=0
bool operator==(const OdGiDisplayStyle &style) const
ODRX_DECLARE_MEMBERS(OdGiDisplayStyle)
void set(const OdGiDisplayStyle &style)
virtual short silhouetteWidth() const =0
void set(const OdGiEdgeStyle &style)
virtual void setIntersectionLinetype(LineType ltype)=0
virtual unsigned long edgeModifiers() const =0
virtual double creaseAngle() const =0
virtual OdCmColorBase & silhouetteColor()=0
virtual void setIsolines(unsigned short nIsolines)=0
virtual EdgeModel edgeModel() const =0
virtual LineType obscuredLinetype() const =0
virtual void setEdgeModifiers(unsigned long nModifiers)=0
virtual void setJitterAmount(JitterAmount amount, bool bEnableModifier)=0
virtual LineType intersectionLinetype() const =0
virtual void setSilhouetteWidth(short nWidth)=0
virtual OdCmColorBase & intersectionColor()=0
virtual const OdCmColorBase & edgeColor() const =0
virtual int haloGap() const =0
virtual void setObscuredColor(const OdCmColorBase &color)=0
virtual JitterAmount jitterAmount() const =0
virtual void setObscuredLinetype(LineType ltype)=0
virtual void setIntersectionColor(const OdCmColorBase &color)=0
virtual const OdCmColorBase & obscuredColor() const =0
virtual void setEdgeWidth(int nWidth, bool bEnableModifier)=0
virtual void setHaloGap(int nHaloGap, bool bEnableModifier)=0
virtual bool isEdgeStyleFlagSet(EdgeStyle flag) const =0
virtual void setEdgeStyleFlag(EdgeStyle flag, bool bEnable)=0
virtual void setEdgeColor(const OdCmColorBase &color, bool bEnableModifier)=0
virtual int edgeWidth() const =0
virtual int overhangAmount() const =0
ODRX_DECLARE_MEMBERS(OdGiEdgeStyle)
virtual void setHidePrecision(bool bHidePrecision)=0
virtual unsigned short isolines() const =0
virtual const OdCmColorBase & intersectionColor() const =0
virtual void setOpacityLevel(double nLevel, bool bEnableModifier)=0
virtual void setWiggleAmount(WiggleAmount amount, bool bEnableModifier)=0
virtual EdgeStyleApply edgeStyleApply() const =0
bool operator==(const OdGiEdgeStyle &style) const
virtual WiggleAmount wiggleAmount() const =0
virtual double opacityLevel() const =0
virtual void setCreaseAngle(double nAngle)=0
virtual bool isEdgeModifierFlagSet(EdgeModifier flag) const =0
virtual void setEdgeStyles(unsigned long nStyles)=0
virtual void setOverhangAmount(int nAmount, bool bEnableModifier)=0
virtual OdCmColorBase & edgeColor()=0
OdGiEdgeStyle & operator=(const OdGiEdgeStyle &style)
virtual unsigned long edgeStyles() const =0
virtual const OdCmColorBase & silhouetteColor() const =0
virtual void setEdgeStyleApply(EdgeStyleApply apply)=0
virtual void setEdgeModifierFlag(EdgeModifier flag, bool bEnable)=0
virtual void setEdgeModel(EdgeModel model)=0
virtual void setSilhouetteColor(const OdCmColorBase &color)=0
virtual bool hidePrecision() const =0
virtual OdCmColorBase & obscuredColor()=0
virtual const OdCmColorBase & monoColor() const =0
virtual void setLightingModel(LightingModel lightingModel)=0
virtual void setMonoColor(const OdCmColorBase &color, bool bEnableMode)=0
virtual void setFaceColorMode(FaceColorMode mode)=0
virtual void setOpacityLevel(double nLevel, bool bEnableModifier)=0
virtual FaceColorMode faceColorMode() const =0
OdGiFaceStyle & operator=(const OdGiFaceStyle &style)
virtual void setFaceModifierFlag(FaceModifier flag, bool bEnable)=0
virtual void setSpecularAmount(double nAmount, bool bEnableModifier)=0
virtual LightingModel lightingModel() const =0
void set(const OdGiFaceStyle &style)
bool operator==(const OdGiFaceStyle &style) const
virtual double opacityLevel() const =0
virtual void setFaceModifiers(unsigned long nModifiers)=0
virtual double specularAmount() const =0
virtual unsigned long faceModifiers() const =0
ODRX_DECLARE_MEMBERS(OdGiFaceStyle)
virtual OdCmColorBase & monoColor()=0
virtual LightingQuality lightingQuality() const =0
virtual bool isFaceModifierFlagSet(FaceModifier flag) const =0
virtual void setLightingQuality(LightingQuality lightingQuality)=0
virtual const OdGiDisplayStyle & displayStyle(void) const =0
virtual void setFaceStyle(const OdGiFaceStyle &style)=0
virtual bool setTrait(Property prop, bool bVal, Operation op=OdGiVisualStyleOperations::kSet)
void configureForType(Type type)
static OdGiVariant::VariantType propertyType(Property prop)
virtual OdGiDisplayStyle & displayStyle(void)=0
virtual void setEdgeStyle(const OdGiEdgeStyle &style)=0
virtual bool setTrait(Property prop, double dVal, Operation op=OdGiVisualStyleOperations::kSet)
virtual bool setTrait(Property prop, double red, double green, double blue, Operation op=OdGiVisualStyleOperations::kSet)
virtual OdGiFaceStyle & faceStyle(void)=0
bool operator==(const OdGiVisualStyle &visualStyle) const
virtual bool setTrait(Property prop, OdInt32 nVal, Operation op=OdGiVisualStyleOperations::kSet)
virtual bool setTrait(Property prop, Operation op)=0
virtual Type type() const =0
virtual bool setType(Type type)=0
virtual const OdGiFaceStyle & faceStyle(void) const =0
virtual void setDisplayStyle(const OdGiDisplayStyle &style)=0
virtual bool setTrait(Property prop, const OdGiVariant *pVal, Operation op=OdGiVisualStyleOperations::kSet)=0
virtual const OdGiEdgeStyle & edgeStyle(void) const =0
OdGiVisualStyle & operator=(const OdGiVisualStyle &visualStyle)
virtual bool setTrait(Property prop, const OdString &pStr, Operation op=OdGiVisualStyleOperations::kSet)
virtual bool traitFlag(Property flagProp, OdUInt32 flagVal) const
virtual OdGiEdgeStyle & edgeStyle(void)=0
OdGiVisualStyleProperties::Property Property
virtual bool setTraitFlag(Property flagProp, OdUInt32 flagVal, bool bEnable=true)
virtual bool setTrait(Property prop, const OdCmEntityColor &pColor, Operation op=OdGiVisualStyleOperations::kSet)
OdGiVisualStyleOperations::Operation Operation
virtual bool setTrait(Property prop, const OdCmColorBase &pColor, Operation op=OdGiVisualStyleOperations::kSet)
virtual Operation operation(Property prop) const =0
ODRX_DECLARE_MEMBERS(OdGiVisualStyle)
virtual OdGiVariantPtr trait(Property prop, Operation *pOp=NULL) const =0
ODRX_DECLARE_MEMBERS(OdGiVisualStyleTraits)
virtual const OdGiVisualStyle & odgiVisualStyle() const =0
virtual void setOdGiVisualStyle(const OdGiVisualStyle &visualStyle)=0
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLfloat GLfloat blue
Definition: gles2_ext.h:147
GLfloat green
Definition: gles2_ext.h:147
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
@ kSpecular
Definition: AveDefs.h:51
@ kDashed
The border is solid.
@ kNone
Light mode is inherited from the annotation.