Panda3D
transform2sg.h
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 transform2sg.h
10  * @author drose
11  * @date 2002-03-12
12  */
13 
14 #ifndef TRANSFORM2SG_H
15 #define TRANSFORM2SG_H
16 
17 #include "pandabase.h"
18 
19 #include "dataNode.h"
20 #include "pandaNode.h"
21 
22 /**
23  * input: Transform (matrix)
24  *
25  * output: none, but applies the matrix as the transform transition for a
26  * given arc of the scene graph.
27  */
28 class EXPCL_PANDA_TFORM Transform2SG : public DataNode {
29 PUBLISHED:
30  explicit Transform2SG(const std::string &name);
31 
32  void set_node(PandaNode *node);
33  PandaNode *get_node() const;
34 
35 private:
36  PT(PandaNode) _node;
37 
38 protected:
39  // Inherited from DataNode
40  virtual void do_transmit_data(DataGraphTraverser *trav,
41  const DataNodeTransmit &input,
42  DataNodeTransmit &output);
43 
44 private:
45  // inputs
46  int _transform_input;
47 
48 public:
49  static TypeHandle get_class_type() {
50  return _type_handle;
51  }
52  static void init_type() {
53  DataNode::init_type();
54  register_type(_type_handle, "Transform2SG",
55  DataNode::get_class_type());
56  }
57  virtual TypeHandle get_type() const {
58  return get_class_type();
59  }
60  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
61 
62 private:
63  static TypeHandle _type_handle;
64 };
65 
66 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
The fundamental type of node for the data graph.
Definition: dataNode.h:52
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
input: Transform (matrix)
Definition: transform2sg.h:28
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Encapsulates the data generated from (or sent into) any particular DataNode.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...