Fade2.5D Documentation pages v1.97
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  explicit Visualizer3(const char* name);
70  ~Visualizer3();
71  void closeFile();
72  void writeNormals(const std::vector<Triangle2*>& vT,double scale);
73  void writePoints(const std::vector<Point2*>& vPoints,unsigned linewidth,const char* color) ;
74  void writePoints(const std::vector<Point2>& vPoints,unsigned linewidth,const char* color) ;
75 
76  void writePoint(const Point2& p,unsigned linewidth,const char* color);
77  void writeSegment(const Point2& src,const Point2& trg,const char* color,bool bWithEndPoints=false);
78  void writeSegments(const std::vector<Segment2>& vSegments,const char* color,bool bWithEndPoints=false);
79  void writeSegments(const std::vector<Edge2>& vSegments,const char* color,bool bWithEndPoints=false);
80  void writeVertexPairs(const std::vector<VertexPair2>& vVertexPairs,const char* color);
81  void writeCubes(const std::vector<Point2>& vPoints,const char* color);
82  void writeTriangles(const std::vector<Triangle2*>& vT,const char* color,bool bWithNormals=false);
83  void writeTriangles(const std::vector<Point2>& vTriangleCorners,const char* color,bool bWithNNV);
84  void writeTriangle(const Triangle2& t,const char* color);
85  void writeTriangle(const Point2& p0,const Point2& p1,const Point2& p2,const char* color);
86  void writeBall(Point2& p,double radius);
87  void setBackfaces(bool bWithBackfaces_);
88 private:
89  void startList(size_t numPoints,size_t numTriangles,bool bWithEdges);
90  void endList();
91  std::ofstream* pOutFile;
92  static int nextColor;
93  bool bWithBackfaces;
94 };
95 
96 } // NAMESPACE FADE25D
97 
98 #elif GEOM_PSEUDO3D==GEOM_FALSE
99 #else
100 #error GEOM_PSEUDO3D is not defined
101 #endif
102 
Point.
Definition: Point2.h:43
Triangle.
Definition: Triangle2.h:59
Visualizer3 is a 3D scene writer for the Geomview viewer.
Definition: Visualizer3.h:37