Changeset 6094

Show
Ignore:
Timestamp:
02/05/07 14:44:16
Author:
robert
Message:

Added Camera's s/getCameraThread() and updated wrappers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/genwrapper.conf

    r6061 r6094  
    300300end 
    301301 
     302 
     303configure reflector "osg::DeleteHandler" 
     304        object-type 
     305end 
     306 
    302307############################################################################# 
    303308 
  • OpenSceneGraph/trunk/include/osg/Camera

    r6012 r6094  
    319319         
    320320         
     321        /** Create a operation thread for this camera.*/ 
     322        void createCameraThread(); 
     323 
     324        /** Assign a operation thread to the camera.*/ 
     325        void setCameraThread(OperationsThread* gt); 
     326 
     327        /** Get the operation thread assigned to this camera.*/ 
     328        OperationsThread* getCameraThread() { return _cameraThread.get(); } 
     329 
     330        /** Get the const operation thread assigned to this camera.*/ 
     331        const OperationsThread* getCameraThread() const { return _cameraThread.get(); } 
     332 
     333 
     334 
    321335        /** Set the GraphicsContext that provides the mechansim for managing the OpenGL graphics context associated with this camera.*/ 
    322336        void setGraphicsContext(GraphicsContext* context); 
     
    408422        BufferAttachmentMap         _bufferAttachmentMap; 
    409423 
     424        ref_ptr<OperationsThread>           _cameraThread; 
     425         
    410426        ref_ptr<GraphicsContext>            _graphicsContext; 
     427         
    411428        buffered_object< ref_ptr<Object> >  _renderingCache; 
    412429         
  • OpenSceneGraph/trunk/include/osg/DeleteHandler

    r6090 r6094  
    7272    protected: 
    7373 
     74        DeleteHandler(const DeleteHandler&) {} 
     75        DeleteHandler operator = (const DeleteHandler&) { return *this; } 
     76 
    7477        int                 _numFramesToRetainObjects; 
    7578        int                 _currentFrameNumber; 
  • OpenSceneGraph/trunk/src/osg/Camera.cpp

    r5882 r6094  
    5757Camera::~Camera() 
    5858{ 
     59    setCameraThread(0); 
     60     
    5961    if (_graphicsContext.valid()) _graphicsContext->removeCamera(this); 
    6062} 
     
    302304} 
    303305 
     306void Camera::createCameraThread() 
     307{ 
     308    if (!_cameraThread) 
     309    { 
     310        setCameraThread(new OperationsThread); 
     311    } 
     312} 
     313 
     314void Camera::setCameraThread(OperationsThread* gt) 
     315{ 
     316    if (_cameraThread==gt) return;  
     317 
     318    if (_cameraThread.valid())  
     319    { 
     320        // need to kill the thread in some way... 
     321        _cameraThread->cancel(); 
     322        _cameraThread->setParent(0); 
     323    } 
     324 
     325    _cameraThread = gt; 
     326     
     327    if (_cameraThread.valid())  
     328    { 
     329        _cameraThread->setParent(this); 
     330    } 
     331} 
     332 
     333 
  • OpenSceneGraph/trunk/src/osgWrappers/osg/Camera.cpp

    r6016 r6094  
    1515#include <osg/CopyOp> 
    1616#include <osg/GraphicsContext> 
     17#include <osg/GraphicsThread> 
    1718#include <osg/Image> 
    1819#include <osg/Matrix> 
     
    330331                  "Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads. ", 
    331332                  ""); 
     333        I_Method0(void, createCameraThread, 
     334                  __void__createCameraThread, 
     335                  "Create a operation thread for this camera. ", 
     336                  ""); 
     337        I_Method1(void, setCameraThread, IN, osg::OperationsThread *, gt, 
     338                  __void__setCameraThread__OperationsThread_P1, 
     339                  "Assign a operation thread to the camera. ", 
     340                  ""); 
     341        I_Method0(osg::OperationsThread *, getCameraThread, 
     342                  __OperationsThread_P1__getCameraThread, 
     343                  "Get the operation thread assigned to this camera. ", 
     344                  ""); 
     345        I_Method0(const osg::OperationsThread *, getCameraThread, 
     346                  __C5_OperationsThread_P1__getCameraThread, 
     347                  "Get the const operation thread assigned to this camera. ", 
     348                  ""); 
    332349        I_Method1(void, setGraphicsContext, IN, osg::GraphicsContext *, context, 
    333350                  __void__setGraphicsContext__GraphicsContext_P1, 
     
    389406                         __BufferAttachmentMap_R1__getBufferAttachmentMap,  
    390407                         0); 
     408        I_SimpleProperty(osg::OperationsThread *, CameraThread,  
     409                         __OperationsThread_P1__getCameraThread,  
     410                         __void__setCameraThread__OperationsThread_P1); 
    391411        I_SimpleProperty(const osg::Vec4 &, ClearColor,  
    392412                         __C5_Vec4_R1__getClearColor,  
  • OpenSceneGraph/trunk/src/osgWrappers/osg/DeleteHandler.cpp

    r6088 r6094  
    2626TYPE_NAME_ALIAS(std::list< osg::DeleteHandler::FrameNumberObjectPair >, osg::DeleteHandler::ObjectsToDeleteList); 
    2727 
    28 BEGIN_VALUE_REFLECTOR(osg::DeleteHandler) 
     28BEGIN_OBJECT_REFLECTOR(osg::DeleteHandler) 
    2929        I_ConstructorWithDefaults1(IN, int, numberOfFramesToRetainObjects, 0, 
    3030                                   ____DeleteHandler__int,