Panda3D
 All Classes Functions Variables Enumerations
eggLine.cxx
1 // Filename: eggLine.cxx
2 // Created by: drose (14Oct03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "eggLine.h"
16 
17 #include "indent.h"
18 
19 TypeHandle EggLine::_type_handle;
20 
21 
22 ////////////////////////////////////////////////////////////////////
23 // Function: EggLine::Destructor
24 // Access: Published, Virtual
25 // Description:
26 ////////////////////////////////////////////////////////////////////
27 EggLine::
28 ~EggLine() {
29  clear();
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: EggLine::write
34 // Access: Public, Virtual
35 // Description: Writes the point to the indicated output stream in
36 // Egg format.
37 ////////////////////////////////////////////////////////////////////
38 void EggLine::
39 write(ostream &out, int indent_level) const {
40  write_header(out, indent_level, "<Line>");
41 
42  if (has_thick()) {
43  indent(out, indent_level + 2)
44  << "<Scalar> thick { " << get_thick() << " }\n";
45  }
46 
47  write_body(out, indent_level + 2);
48  indent(out, indent_level) << "}\n";
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: EggLine::get_num_lead_vertices
53 // Access: Protected, Virtual
54 // Description: Returns the number of initial vertices that are not
55 // used in defining any component; the first component
56 // is defined by the (n + 1)th vertex, and then a new
57 // component at each vertex thereafter.
58 ////////////////////////////////////////////////////////////////////
59 int EggLine::
60 get_num_lead_vertices() const {
61  return 1;
62 }
void write_header(ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
void clear()
Removes all of the vertices from the primitive.
Definition: eggPrimitive.I:432
virtual void write(ostream &out, int indent_level) const
Writes the point to the indicated output stream in Egg format.
Definition: eggLine.cxx:39
double get_thick() const
Returns the thickness set on this particular line.
Definition: eggLine.I:71
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85