Panda3D
 All Classes Functions Variables Enumerations
cfCommand.h
1 // Filename: cfCommand.h
2 // Created by: drose (19Feb09)
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 CFCOMMAND_H
16 #define CFCOMMAND_H
17 
18 #include "pandabase.h"
19 
20 #include "typedWritableReferenceCount.h"
21 #include "pandaNode.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : CFCommand
25 // Description : A single command in the Connected-Frame protocol.
26 // This can be sent client-to-server or
27 // server-to-client.
28 //
29 // This is an abstract base class. Individual commands
30 // will specialize from this.
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_CFTALK CFCommand : public TypedWritableReferenceCount {
33 protected:
34  CFCommand();
35 
36 PUBLISHED:
37  virtual ~CFCommand();
38 
39 public:
40  static TypeHandle get_class_type() {
41  return _type_handle;
42  }
43  static void init_type() {
44  TypedWritableReferenceCount::init_type();
45  register_type(_type_handle, "CFCommand",
46  TypedWritableReferenceCount::get_class_type());
47  }
48  virtual TypeHandle get_type() const {
49  return get_class_type();
50  }
51  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
52 
53 private:
54  static TypeHandle _type_handle;
55 };
56 
57 ////////////////////////////////////////////////////////////////////
58 // Class : CFDoCullCommand
59 // Description : Starts the cull process for a particular
60 // DisplayRegion.
61 ////////////////////////////////////////////////////////////////////
62 class EXPCL_CFTALK CFDoCullCommand : public CFCommand {
63 protected:
64  INLINE CFDoCullCommand();
65 PUBLISHED:
66  INLINE CFDoCullCommand(PandaNode *scene);
67 
68  INLINE PandaNode *get_scene() const;
69 
70 private:
71  PT(PandaNode) _scene;
72 
73 public:
74  static void register_with_read_factory();
75  virtual void write_datagram(BamWriter *manager, Datagram &dg);
76  virtual void update_bam_nested(BamWriter *manager);
77  virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
78 
79 protected:
80  static TypedWritable *make_from_bam(const FactoryParams &params);
81  void fillin(DatagramIterator &scan, BamReader *manager);
82 
83 public:
84  static TypeHandle get_class_type() {
85  return _type_handle;
86  }
87  static void init_type() {
88  CFCommand::init_type();
89  register_type(_type_handle, "CFDoCullCommand",
90  CFCommand::get_class_type());
91  }
92  virtual TypeHandle get_type() const {
93  return get_class_type();
94  }
95  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
96 
97 private:
98  static TypeHandle _type_handle;
99 };
100 
101 #include "cfCommand.I"
102 
103 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This is our own Panda specialization on the default STL list.
Definition: plist.h:38
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A single command in the Connected-Frame protocol.
Definition: cfCommand.h:32
Starts the cull process for a particular DisplayRegion.
Definition: cfCommand.h:62
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual void update_bam_nested(BamWriter *manager)
Called by the BamWriter when this object has not itself been modified recently, but it should check i...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43