VR-Forces 4.1 Class Documentation
terrainPolygonDrawer.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2006 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: terrainPolygonDrawer.h,v $ $Revision: 1.3 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef TERRAINPOLYGONDRAWER_H
13 #define TERRAINPOLYGONDRAWER_H
14 
17 
18 #include <QtGui/QColor>
19 
20 class DtGroup;
21 class DtGdbNode;
23 class DtLevelOfDetail;
25 class DtFeature;
26 class DtFileNode;
27 class DtAllTypesPolygon;
28 
34 
35 typedef QColor (*DtPolygonColorFcn)(const DtAllTypesPolygon*, const DtViewportExtents* v, void* usr);
36 
38 {
39 public:
42 
43  virtual ~DtTerrainPolygonDrawer();
44 
46 
48  void setDrawBoundingVolumes(bool);
49  bool drawBoundingVolumes() const;
50 
51  void setBoundingVolumesColor(const QColor&);
52  const QColor& boundingVolumesColor() const;
53 
54  void setPolygonColorFcn(DtPolygonColorFcn, void*);
55 
56  static DtTerrainPolygonDrawer* create();
57 
59  virtual void drawPolygons(const DtAllTypesPolygon *polygon,
60  const DtViewportExtents* v, DtPrimitiveDrawer* painter);
61 
63  virtual void colorPolygonByHeight(DtAllTypesPolygon& thePolygon, const DtViewportExtents* v);
64 
65 protected:
66  virtual void internalDraw(const DtTerrainDatabase*, const DtViewportExtents*, DtPrimitiveDrawer* painter);
67 
68 protected:
70  virtual void drawAllNodeTypes(const DtGdbNode* node,
71  const DtHomogeneousTransfMatrix &matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
72 
73  virtual void drawGroup(const DtGroup *group,
74  const DtHomogeneousTransfMatrix &matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
75 
76  virtual void drawLevelOfDetail(const DtLevelOfDetail *level_of_detail,
77  const DtHomogeneousTransfMatrix &matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
78 
79  virtual void drawCoordinateSystem(const DtBaseCoordinateSystem *cs,
80  const DtHomogeneousTransfMatrix &matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
81 
82  virtual void drawFeature(const DtFeature *moddef,
83  const DtHomogeneousTransfMatrix &matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
84 
85  virtual void drawFileNode(const DtFileNode* fileNode,
86  const DtHomogeneousTransfMatrix& matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
87 
88  virtual void drawPolygon(const DtAllTypesPolygon *polygon,
89  const DtHomogeneousTransfMatrix& matrix, const DtViewportExtents* v, DtPrimitiveDrawer* painter);
90 
91 protected:
93  virtual QColor polygonColor(const DtAllTypesPolygon*, const DtViewportExtents* v);
94 
95 public:
96  static QColor polygonSurfaceColor(const DtAllTypesPolygon*, const DtViewportExtents* v, void* usr);
97  static QColor polygonSoilTypeColor(const DtAllTypesPolygon*, const DtViewportExtents* v, void* usr);
98  static QColor polygonTerrainShadingSurfaceColor(const DtAllTypesPolygon*, const DtViewportExtents* v, void* usr);
99  static QColor polygonTerrainShadingSoilTypeColor(const DtAllTypesPolygon*, const DtViewportExtents* v, void* usr);
100  static QColor polygonTerrainShadingFromColor(const DtAllTypesPolygon* p, const QColor& baseColor, const DtViewportExtents* v);
101 
102 protected:
107 };
108 
110 {
112 }
113 
115 {
116  return myDrawBoundingVolumes;
117 }
118 
120 {
122 }
123 
125 {
126  return myBoundingVolumesColor;
127 }
128 
130 {
131  myPolygonColorFcn = fcn;
132  myPolygonColorData = usr;
133 }
134 
135 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)