Panda3D
eggPatch.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file eggPatch.cxx
10  * @author drose
11  * @date 2012-04-27
12  */
13 
14 #include "eggPatch.h"
15 #include "eggGroupNode.h"
16 #include "plane.h"
17 
18 #include "indent.h"
19 
20 #include <algorithm>
21 
22 TypeHandle EggPatch::_type_handle;
23 
24 /**
25  * Makes a copy of this object.
26  */
28 make_copy() const {
29  return new EggPatch(*this);
30 }
31 
32 /**
33  * Writes the patch to the indicated output stream in Egg format.
34  */
35 void EggPatch::
36 write(std::ostream &out, int indent_level) const {
37  write_header(out, indent_level, "<Patch>");
38  write_body(out, indent_level+2);
39  indent(out, indent_level) << "}\n";
40 }
void write_header(std::ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual EggPatch * make_copy() const override
Makes a copy of this object.
Definition: eggPatch.cxx:28
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single "patch", a special primitive to be rendered only with a tessellation shader.
Definition: eggPatch.h:25
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual void write(std::ostream &out, int indent_level) const override
Writes the patch to the indicated output stream in Egg format.
Definition: eggPatch.cxx:36
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.