Simon Mills (simon++at++wgs.estec.esa.nl)
Fri, 16 Jul 1999 17:43:10 +0200
Yes, thanks I also came to realize that too. The trouble is it isn't
helping me. Does any C++ expert out there know the right C++ trick to
get it to work? I've tried adding my own empty pfNode constructor but it
won't compile. The workaround for now is to subclass pfGroup which works
OK but wasn't what I wanted.
> Good luck,
> Charlie Curry
>
> On Thu, 15 Jul 1999, Simon Mills wrote:
>
> > Hi,
> >
> > I'm trying to subclass pfNode to make my own (sound) pfNode type. It
> > works if I subclass a pfGroup but I'm having trouble compiling if I use
> > pfNode. The error I get is:
> >
> > "../pfSoundSource.c++", line 27: error(1264): no default constructor
> > exists
> > for class "pfNode"
> > {
> >
> > ... and this is the relevant code parts:
> >
> > ----- pfSoundSource.c++ ------
> >
> > #include <Performer/pf/pfNode.h>
> > #include <Performer/pr/pfMemory.h>
> > #include <Performer/pr/pfLinMath.h>
> > #include <Performer/pf/pfTraverser.h>
> > #include "pfSoundSource.h"
> >
> >
> > pfType *pfSoundSource::classType = NULL;
> >
> >
> > void
> > pfSoundSource::init() /* Define class type */
> > {
> > if (classType == NULL) {
> > pfNode::init();
> > classType = new pfType(pfNode::getClassType(), "pfSoundSource");
> > }
> > }
> >
> >
> > pfSoundSource::pfSoundSource(char *fName) // Constructor with loading
> > {
> > pfMemory::setType(classType);
> >
> > /* Initialise properties */
> > ...
> > }
> >
> > ---- end pfSoundSource.c++ -----
> >
> > ---- pfSoundSource.h ----
> >
> > class pfSoundSource : public pfNode
> > {
> > private:
> > static pfType *classType;
> >
> > private:
> > ...
> >
> > public: /* constructor/destructor */
> > pfSoundSource(); // without loading (default)
> > pfSoundSource(char *fName); // with loading
> > ~pfSoundSource(void);
> >
> > public: /* type */
> > static void init();
> > static pfType *getClassType() { return classType; }
> >
> > }
> >
> > ---- end pfSoundSource.h ----
> >
> >
> > Does anyone know what I'm doing wrong or recognise this problem? I've
> > followed the recommendations in the Performer Programming Guide but I
> > guess I'm missing something because pfNode is only a container class.
> >
Help!
Simon
________________________________________________________________________
Simon C. Mills
Modelling & Simulation Section (TOS-EMM) Tel: +31 (0)71 565 3725
European Space Agency (ESA/ESTEC) Fax: +31 (0)71 565 5419
Postbus 299, 2200AG Noordwijk e-mail: simon++at++wgs.estec.esa.nl
The Netherlands http://www.estec.esa.nl/wmwww/EMM
________________________________________________________________________
This archive was generated by hypermail 2.0b2 on Fri Jul 16 1999 - 08:43:21 PDT