Panda3D
transform2sg.h
1 // Filename: transform2sg.h
2 // Created by: drose (12Mar02)
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 #ifndef TRANSFORM2SG_H
16 #define TRANSFORM2SG_H
17 
18 #include "pandabase.h"
19 
20 #include "dataNode.h"
21 #include "pandaNode.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : Transform2SG
25 // Description : input: Transform (matrix)
26 //
27 // output: none, but applies the matrix as the transform
28 // transition for a given arc of the scene graph.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDA_TFORM Transform2SG : public DataNode {
31 PUBLISHED:
32  Transform2SG(const string &name);
33 
34  void set_node(PandaNode *node);
35  PandaNode *get_node() const;
36 
37 private:
38  PT(PandaNode) _node;
39 
40 protected:
41  // Inherited from DataNode
42  virtual void do_transmit_data(DataGraphTraverser *trav,
43  const DataNodeTransmit &input,
44  DataNodeTransmit &output);
45 
46 private:
47  // inputs
48  int _transform_input;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  DataNode::init_type();
56  register_type(_type_handle, "Transform2SG",
57  DataNode::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
68 #endif
69 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
The fundamental type of node for the data graph.
Definition: dataNode.h:64
input: Transform (matrix)
Definition: transform2sg.h:30
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
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...