Skeleton classes

This commit is contained in:
Josh Yelon 2007-02-09 18:08:53 +00:00
parent 834e06d5d4
commit 4c5c11c0c8
8 changed files with 269 additions and 0 deletions

27
panda/src/skel/Sources.pp Normal file
View File

@ -0,0 +1,27 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
dtoolutil:c dtoolbase:c dtool:m prc:c
#define USE_PACKAGES
#begin lib_target
#define TARGET skel
#define LOCAL_LIBS \
display text pgraph gobj linmath putil
#define COMBINED_SOURCES $[TARGET]_composite1.cxx
#define SOURCES \
config_skel.h \
basicSkel.I basicSkel.h
#define INCLUDED_SOURCES \
config_skel.cxx \
basicSkel.cxx
#define INSTALL_HEADERS \
basicSkel.h basicSkel.I
#define IGATESCAN all
#end lib_target

View File

@ -0,0 +1,56 @@
// Filename: basicSkel.I
// Created by: jyelon (31Jan07)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE BasicSkel::
BasicSkel() {
}
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::Destructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE BasicSkel::
~BasicSkel() {
}
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::set_value
// Access: Public
// Description: Stores an integer value.
////////////////////////////////////////////////////////////////////
INLINE void BasicSkel::
set_value(int n) {
_value = n;
}
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::get_value
// Access: Public
// Description: Retreives a value that was previously stored.
////////////////////////////////////////////////////////////////////
INLINE int BasicSkel::
get_value() {
return _value;
}

View File

@ -0,0 +1,43 @@
// Filename: basicSkel.cxx
// Created by: jyelon (31Jan07)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "basicSkel.h"
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::set_value_alt
// Access: Public
// Description: Stores an integer value. Exact same functionality
// as set_value, except that this isn't an inline
// function.
////////////////////////////////////////////////////////////////////
void BasicSkel::
set_value_alt(int n) {
_value = n;
}
////////////////////////////////////////////////////////////////////
// Function: BasicSkel::get_value
// Access: Public
// Description: Retreives a value that was previously stored.
// Exact same functionality as get_value, except
// that this isn't an inline function.
////////////////////////////////////////////////////////////////////
int BasicSkel::
get_value_alt() {
return _value;
}

View File

@ -0,0 +1,53 @@
// Filename: basicSkel.h
// Created by: jyelon (31Jan07)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#ifndef BASICSKEL_H
#define BASICSKEL_H
#include "pandabase.h"
////////////////////////////////////////////////////////////////////
// Class : BasicSkel
// Description : This is the most basic of the skeleton classes.
// It stores an integer, and will return it on request.
//
// The skeleton classes are intended to help you learn
// how to add C++ classes to panda. See also the manual,
// "Adding C++ Classes to Panda."
////////////////////////////////////////////////////////////////////
class EXPCL_PANDASKEL BasicSkel {
PUBLISHED:
INLINE BasicSkel();
INLINE ~BasicSkel();
// These inline functions allow you to get and set _value.
INLINE void set_value(int n);
INLINE int get_value();
// These do the same thing as the functions above.
void set_value_alt(int n);
int get_value_alt();
private:
int _value;
};
#include "basicSkel.I"
#endif

View File

@ -0,0 +1,51 @@
// Filename: config_skel.cxx
// Created by: jyelon (09Feb07)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "config_skel.h"
#include "dconfig.h"
Configure(config_skel);
NotifyCategoryDef(skel, "");
ConfigureFn(config_skel) {
init_libskel();
}
ConfigVariableInt skel_number_of_monkeys
("skel-sample-config-variable", 3);
////////////////////////////////////////////////////////////////////
// Function: init_libskel
// Description: Initializes the library. This must be called at
// least once before any of the functions or classes in
// this library can be used. Normally it will be
// called by the static initializers and need not be
// called explicitly, but special cases exist.
////////////////////////////////////////////////////////////////////
void
init_libskel() {
static bool initialized = false;
if (initialized) {
return;
}
initialized = true;
// There's no initialization necessary for the skel library.
// But if there were, we would put it here.
}

View File

@ -0,0 +1,36 @@
// Filename: config_skel.h
// Created by: jyelon (09Feb07)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#ifndef CONFIG_SKEL_H
#define CONFIG_SKEL_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "configVariableDouble.h"
#include "configVariableString.h"
#include "configVariableInt.h"
NotifyCategoryDecl(skel, EXPCL_PANDASKEL, EXPTP_PANDASKEL);
extern ConfigVariableInt skel_sample_config_variable;
extern EXPCL_PANDASKEL void init_libskel();
#endif

View File

@ -0,0 +1 @@
#include "skel_composite1.cxx"

View File

@ -0,0 +1,2 @@
#include "config_skel.cxx"
#include "basicSkel.cxx"