modstack.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**********************************************************************
  2. *<
  3. FILE: modstack.h
  4. DESCRIPTION:
  5. CREATED BY: Rolf Berteig
  6. HISTORY: created January 20, 1996
  7. *> Copyright (c) 1994, All Rights Reserved.
  8. **********************************************************************/
  9. #ifndef __MODSTACK__
  10. #define __MODSTACK__
  11. // These are the class IDs for object space derived objects and
  12. // world space derived objects
  13. extern CoreExport Class_ID derivObjClassID;
  14. extern CoreExport Class_ID WSMDerivObjClassID;
  15. class IDerivedObject : public Object {
  16. public:
  17. // Adds a modifier to the derived object.
  18. // before = 0 :Place modifier at the end of the pipeline (top of stack)
  19. // before = NumModifiers() :Place modifier at the start of the pipeline (bottom of stack)
  20. virtual void AddModifier(Modifier *mod, ModContext *mc=NULL, int before=0)=0;
  21. virtual void DeleteModifier(int index=0)=0;
  22. virtual int NumModifiers()=0;
  23. // Searches down the pipeline for the base object (an object that is not a
  24. // derived object). May step into other derived objects
  25. virtual Object *FindBaseObject()=0;
  26. // Get and set the object that this derived object reference.
  27. // This is the next object down in the stack and may be the base object.
  28. virtual Object *GetObjRef()=0;
  29. virtual RefResult ReferenceObject(Object *pob)=0;
  30. // Access the ith modifier.
  31. virtual Modifier *GetModifier(int index)=0;
  32. // Replaces the ith modifier in the stack
  33. virtual void SetModifier(int index, Modifier *mod)=0;
  34. // Access the mod context for the ith modifier
  35. virtual ModContext* GetModContext(int index)=0;
  36. };
  37. // Create a world space or object space derived object.
  38. // If the given object pointer is non-NULL then the derived
  39. // object will be set up to reference that object.
  40. CoreExport IDerivedObject *CreateWSDerivedObject(Object *pob=NULL);
  41. CoreExport IDerivedObject *CreateDerivedObject(Object *pob=NULL);
  42. #endif //__MODSTACK__