MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoCSO/SoView2DCSOEditor/SoView2DCSOExtensibleEditor/extensions/SoCSOEllipseEditor/SoCSOEllipseEditor.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 
00011 
00012 #ifndef __SoCSOEllipseEditor_H
00013 #define __SoCSOEllipseEditor_H
00014 
00015 #include <SoView2DCSOEditor/SoView2DCSOExtensibleEditor/SoCSOCreatorEditorExtension.h>
00016 
00018 
00020 class SOCSO_EXPORT SoCSOEllipseEditor : public SoCSOCreatorEditorExtension
00021 {
00022   SO_NODE_HEADER(SoCSOEllipseEditor);
00023 
00024 public:
00025 
00027   SoCSOEllipseEditor();
00028 
00030   SoSFBool isCircle;
00032   SoSFFloat ellipseCreationRatio;
00033 
00035   static void initClass();
00036 
00037   virtual void createStartPressAt(const SoPointerPosition& pos);
00038   
00039   virtual void createDragMoveTo(const SoPointerPosition& pos);
00040   virtual bool createEndPress(int clickCount);
00041 
00042   virtual void selectAndMoveStartPressAt(const SoPointerPosition& pos);
00043   virtual void selectAndMoveDragMoveTo(const SoPointerPosition& pos);
00044   virtual SoPointingAction* selectAndMoveEndPress(int clickCount);
00045 
00046   virtual int cursorShape() const { return SoViewerProxy::CROSS_OVAL_CURSOR; }
00047 
00048 protected:
00049 
00050 private:
00051 
00054   void interpolateEllipseSeedAndPathPoints(const SoPointerPosition& pos, bool isCreating);
00056   unsigned int getHitSeedPointIndex() const;
00058   void generatePathPointsForHitCSO();
00060   void createNewCSO(const SoPointerPosition& pos);
00061 
00062   ml::CSO* _newCSO;
00063   SbVec3f  _startPosition;
00064 };
00065 
00067 
00068 #endif // __SoCSOEllipseEditor_H