Fade2.5D Documentation pages v2.12
Delaunay Features
Visualizer3.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 #pragma once
20 
21 
22 
23 #include "common.h"
24 #if GEOM_PSEUDO3D==GEOM_TRUE
25 
26 #include "Point2.h"
27 #include "Segment2.h"
28 #include "VertexPair2.h"
29 #include "Edge2.h"
30 namespace GEOM_FADE25D
31 {
32 
33 
36 class CLASS_DECLSPEC Visualizer3
37 {
38 public:
39  static const char * const CLIGHTBLUE;
40  static const char * const CDARKBLUE;
41  static const char * const CYELLOW;
42  static const char * const CPINK;
43  static const char * const CBLACK;
44  static const char * const CLIGHTBROWN;
45  static const char * const CDARKBROWN;
46  static const char * const CORANGE;
47  static const char * const CPURPLE;
48  static const char * const CGRAY;
49  static const char * const CLIGHTGRAY;
50  static const char * const CRED;
51  static const char * const CGREEN;
52  static const char * const CWHITE;
53  static const char * const CRIMSON;
54  static const char * const CDARKORANGE;
55  static const char * const CGOLDENROD;
56  static const char * const COLIVE;
57  static const char * const CLAWNGREEN;
58  static const char * const CGREENYELLOW;
59  static const char * const CPALEGREEN;
60  static const char * const CMEDSPRINGGREEN;
61  static const char * const CLIGHTSEAGREAN;
62  static const char * const CCYAN;
63  static const char * const CSTEELBLUE;
64  static const char * const MIDNIGHTBLUE;
65  static const char * const CWHEAT;
66  static const char * getColor(int i);
67  static const char * getNextColor();
68  static const char * getNextColorAndName(const char*&);
69  static int getNextColorNum();
70  explicit Visualizer3(const char* name);
71  ~Visualizer3();
72 
73  void closeFile();
74  void writeNormals(const std::vector<Triangle2*>& vT,double scale);
75  void writePoints(const std::vector<Point2*>& vPoints,unsigned linewidth,const char* color) ;
76  void writePoints(const std::vector<Point2>& vPoints,unsigned linewidth,const char* color) ;
77 
78  void writePoint(const Point2& p,unsigned linewidth,const char* color);
79  void writeSegment(const Point2& src,const Point2& trg,const char* color,bool bWithEndPoints=false);
80  void writeSegments(const std::vector<Segment2>& vSegments,const char* color,bool bWithEndPoints=false);
81  void writeSegments(const std::vector<Edge2>& vSegments,const char* color,bool bWithEndPoints=false);
82  void writeVertexPairs(const std::vector<VertexPair2>& vVertexPairs,const char* color);
83  void writeCubes(const std::vector<Point2>& vPoints,const char* color);
84  void writeTriangles(const std::vector<Triangle2*>& vT,const char* color,bool bWithNormals=false);
85  void writeTriangles(const std::vector<Point2>& vTriangleCorners,const char* color,bool bWithNNV);
86  void writeTriangle(const Triangle2& t,const char* color);
87  void writeTriangle(const Point2& p0,const Point2& p1,const Point2& p2,const char* color);
88  void writeBall(const Point2& p,double radius);
89  void setBackfaces(bool bWithBackfaces_);
90 private:
91  Visualizer3(const Visualizer3&);
92  Visualizer3& operator=(const Visualizer3&);
93  void startList(size_t numPoints,size_t numTriangles,bool bWithEdges);
94  void endList();
95  std::ofstream* pOutFile;
96  static int nextColor;
97  bool bWithBackfaces;
98 };
99 
100 } // NAMESPACE FADE25D
101 
102 #elif GEOM_PSEUDO3D==GEOM_FALSE
103 #else
104 #error GEOM_PSEUDO3D is not defined
105 #endif
106 
Point.
Definition: Point2.h:52
Triangle.
Definition: Triangle2.h:60
Visualizer3 is a 3D scene writer for the Geomview viewer.
Definition: Visualizer3.h:37