Geom Software - C++ Programming and Geometry Libraries
Fade3D Documentation pages v0.99
/home/geom/repo/dev/geomDev/dt3/dt3Library/Visualizer3.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade3D 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 
18 #pragma once
19 #include <vector>
20 #include <iostream>
21 #include <fstream>
22 #include "Ball3.h"
23 #include "Triangle3.h"
24 #include "Bbox3.h"
25 namespace FADE3D {
26 
30 {
31 public:
32  explicit Visualizer3(const std::string& filename);
33  ~Visualizer3();
34  void closeFile();
35  void openFile(std::string filename);
36  //void writePoints(std::vector<Point3>& vPoints,unsigned linewidth,const std::string& color) ;
37  //void writePoint(Point3& p,unsigned linewidth,const std::string& color);
38  void writeBall(Ball3* ball);
39  void writeBall(const Point3& center,double weight,bool bTransparent=false);
40  void writeBalls(const std::vector<Ball3>& vBalls,bool bTransparent=false);
41  void writeSegment(const Point3& src,const Point3& trg,const std::string& c);
42  void writePolygon(std::vector<Point3>& vPoints,const std::string& c);
43  void writeTetrahedron(Tet3* pTet,const std::string& c);
44  void writeTriangle(Triangle3* pT,const std::string& c);
45  void writeTriangles(std::vector<Triangle3*> vTriangles,const std::string& c);
46  void writeBbox(const Bbox3& bbx,const std::string& c);
47 
48  void writePoint(const Point3& p,unsigned lineWidth,const std::string& color);
49  void writePoints(std::vector<Point3>& vPoints,unsigned lineWidth,const std::string& color);
50  void writePoints(std::vector<Point3*>& vPoints,unsigned lineWidth,const std::string& color);
51 
52  static std::string getNextColor();
53  static std::string getColor(unsigned ith);
54  static std::string getColorName(unsigned ith);
55 
56  static std::string CLIGHTBLUE;
57  static std::string CDARKBLUE;
58  static std::string CYELLOW;
59  static std::string CPINK;
60  static std::string CBLACK;
61  static std::string CLIGHTBROWN;
62  static std::string CDARKBROWN;
63  static std::string CORANGE;
64  static std::string CPURPLE;
65  static std::string CGRAY;
66  static std::string CLIGHTGRAY;
67  static std::string CRED;
68  static std::string CGREEN;
69  static std::string CWHITE;
70  static std::string CRIMSON;
71  static std::string CDARKORANGE;
72  static std::string CGOLDENROD;
73  static std::string COLIVE;
74  static std::string CLAWNGREEN;
75  static std::string CGREENYELLOW;
76  static std::string CPALEGREEN;
77  static std::string CMEDSPRINGGREEN;
78  static std::string CLIGHTSEAGREAN;
79  static std::string CCYAN;
80  static std::string CSTEELBLUE;
81  static std::string MIDNIGHTBLUE;
82  static std::string CWHEAT;
83 
84 
85 protected:
86  std::ofstream outFile;
87  void startList(const size_t numPoints,const size_t numTriangles,bool bWithEdges=true);
88  void endList();
89  static const std::string colorNames[27];
90  static const std::string colorArray[27];
91  static int nextColorIdx;
92 
93 };
94 
95 
96 
97 } // NAMESPACE FADE3D
98 
99 
Definition: Ball3.h:16
Vertex.
Definition: Point3.h:32
Tetrahedron.
Definition: Tet3.h:46
Axis-aligned minimal 3D bounding box.
Definition: Bbox3.h:13
Sphere.
Definition: Ball3.h:20
Geomview visualizations.
Definition: Visualizer3.h:29