Subclassing pfNode

New Message Reply Date view Thread view Subject view Author view

Simon Mills (simon++at++wgs.estec.esa.nl)
Thu, 15 Jul 1999 15:28:49 +0200


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.

Regards, 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
________________________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Jul 15 1999 - 06:27:32 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.