Changeset 1035
- Timestamp:
- 12/21/07 16:07:14 (7 months ago)
- Files:
-
- branches/Carsten_PtrWork2/Source/System/Material/Base/OSGSimpleMaterial.cpp (modified) (5 diffs)
- branches/Carsten_PtrWork2/Source/System/Material/Base/OSGSimpleMaterial.h (modified) (1 diff)
- branches/Carsten_PtrWork2/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp (modified) (2 diffs)
- branches/Carsten_PtrWork2/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h (modified) (1 diff)
- branches/Carsten_PtrWork2/Source/System/NodeCores/Groups/Base/OSGLight.cpp (modified) (1 diff)
- branches/Carsten_PtrWork2/Source/System/NodeCores/Groups/Base/OSGLight.h (modified) (2 diffs)
- branches/Carsten_PtrWork2/Source/System/Window/Utilities/OSGSimpleSceneManager.cpp (modified) (14 diffs)
- branches/Carsten_PtrWork2/Source/System/Window/Utilities/OSGSimpleSceneManager.h (modified) (1 diff)
- branches/Carsten_PtrWork2/Tutorials/01hello.cpp (modified) (2 diffs)
- branches/Carsten_PtrWork2/Tutorials/02move.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/Material/Base/OSGSimpleMaterial.cpp
r1032 r1035 80 80 { 81 81 _materialChunk = MaterialChunk::create(); 82 83 addRef(_materialChunk);84 82 } 85 83 … … 90 88 _blendChunk->setSrcFactor (GL_SRC_ALPHA); 91 89 _blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA); 92 93 addRef(_blendChunk);94 90 } 95 91 } … … 108 104 Inherited::resolveLinks(); 109 105 110 subRefLocalVar(_materialChunk);111 subRefLocalVar(_blendChunk );106 _materialChunk = NullFC; 107 _blendChunk = NullFC; 112 108 } 113 109 … … 152 148 StatePtr SimpleMaterial::makeState(void) 153 149 { 154 State Ptr state = State::create();150 StateRefPtr state = State::create(); 155 151 156 152 Color3f v3; … … 220 216 221 217 _pState->setDefaultSortKey(getContainerId(this)); 222 223 addRef(_pState);224 218 } 225 219 branches/Carsten_PtrWork2/Source/System/Material/Base/OSGSimpleMaterial.h
r996 r1035 98 98 // these chunks are used for rendering the material 99 99 100 MaterialChunk Ptr _materialChunk;101 BlendChunk Ptr _blendChunk;100 MaterialChunkInternalRefPtr _materialChunk; 101 BlendChunkInternalRefPtr _blendChunk; 102 102 103 103 /*---------------------------------------------------------------------*/ branches/Carsten_PtrWork2/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.cpp
r1018 r1035 134 134 */ 135 135 136 DrawableStatsAttachment Ptr DrawableStatsAttachment::calcStatic(136 DrawableStatsAttachmentRefPtr DrawableStatsAttachment::calcStatic( 137 137 DrawablePtrArg pDrawable) 138 138 { 139 DrawableStatsAttachment Ptr st = DrawableStatsAttachment::create();139 DrawableStatsAttachmentRefPtr st = DrawableStatsAttachment::create(); 140 140 141 141 if(pDrawable != NullFC) … … 151 151 AttachmentContainerPtr obj) 152 152 { 153 DrawableStatsAttachment Ptr st = DrawableStatsAttachment::create();153 DrawableStatsAttachmentRefPtr st = DrawableStatsAttachment::create(); 154 154 155 155 st->attachTo(obj); branches/Carsten_PtrWork2/Source/System/NodeCores/Drawables/Base/OSGDrawableStatsAttachment.h
r998 r1035 87 87 void reset(void); 88 88 89 static DrawableStatsAttachment Ptr calcStatic(DrawablePtrArg pDrawable);89 static DrawableStatsAttachmentRefPtr calcStatic(DrawablePtrArg pDrawable); 90 90 91 91 /*! \} */ branches/Carsten_PtrWork2/Source/System/NodeCores/Groups/Base/OSGLight.cpp
r997 r1035 151 151 Light::~Light(void) 152 152 { 153 OSG::subRef(_pChunk ); 153 } 154 155 void 156 Light::resolveLinks(void) 157 { 158 Inherited::resolveLinks(); 159 160 _pChunk = NullFC; 154 161 } 155 162 branches/Carsten_PtrWork2/Source/System/NodeCores/Groups/Base/OSGLight.h
r997 r1035 118 118 protected: 119 119 120 typedef LightBase Inherited;120 typedef LightBase Inherited; 121 121 122 LightChunk Ptr_pChunk;122 LightChunkInternalRefPtr _pChunk; 123 123 124 124 /*---------------------------------------------------------------------*/ … … 136 136 virtual ~Light(void); 137 137 138 virtual void resolveLinks(void); 139 138 140 /*! \} */ 139 141 /*---------------------------------------------------------------------*/ branches/Carsten_PtrWork2/Source/System/Window/Utilities/OSGSimpleSceneManager.cpp
r1023 r1035 178 178 The material used by the highlight object. 179 179 */ 180 SimpleMaterial Ptr SimpleSceneManager::_highlightMaterial;180 SimpleMaterialRefPtr SimpleSceneManager::_highlightMaterial; 181 181 182 182 /*-------------------------------------------------------------------------*/ … … 240 240 setRoot(NullFC); // sub root 241 241 242 if(_internalRoot != NullFC) 243 subRef(_internalRoot); 244 245 if(_camera != NullFC) 246 subRef(_camera); 242 _internalRoot = NullFC; 243 _camera = NullFC; 247 244 } 248 245 … … 438 435 camera->setFar (_camera->getFar()); 439 436 440 for(UInt32 i =0;i<_win->getPort().size();++i)437 for(UInt32 i = 0; i < _win->getPort().size(); ++i) 441 438 { 442 439 ViewportPtr vp = _win->getPort()[i]; … … 447 444 } 448 445 } 449 450 // destroy old camera.451 addRef( camera);452 subRef(_camera);453 446 454 447 _camera = camera; … … 524 517 525 518 // the camera and light beacon 526 Node Ptr cartN = Node::create();527 _cart = Transform::create();519 NodeRefPtr cartN = Node::create(); 520 _cart = Transform::create(); 528 521 529 522 cartN->setCore(_cart); … … 533 526 _headlight = DirectionalLight::create(); 534 527 535 addRef(_internalRoot);536 537 528 _internalRoot->setCore(_headlight); 538 529 _internalRoot->addChild(cartN); 539 540 530 541 531 _headlight->setAmbient (.3, .3, .3, 1); … … 548 538 _camera = PerspectiveCamera::create(); 549 539 550 addRef(_camera);551 552 540 _camera->setBeacon(cartN); 553 541 _camera->setFov (osgDegree2Rad(60.f)); … … 558 546 if(_win->getPort().size() == 0) 559 547 { 560 SolidBackground Ptr bg = SolidBackground::create();548 SolidBackgroundRefPtr bg = SolidBackground::create(); 561 549 562 550 bg->setColor(Color3f(0.2, 0.2, 0.2)); … … 564 552 _foreground = ImageForeground::create(); 565 553 566 SimpleStatisticsForeground Ptr sf = SimpleStatisticsForeground::create();554 SimpleStatisticsForegroundRefPtr sf = SimpleStatisticsForeground::create(); 567 555 568 556 sf->setSize(25); … … 664 652 addRef(_statforeground); 665 653 666 Viewport Ptr vp = Viewport::create();654 ViewportRefPtr vp = Viewport::create(); 667 655 668 656 vp->setCamera (_camera); … … 725 713 void SimpleSceneManager::useOpenSGLogo(void) 726 714 { 727 Image Ptr lo = Image::create();715 ImageRefPtr lo = Image::create(); 728 716 ImageFileType::restore( lo, (UChar8*)LogoData, -1 ); 729 717 … … 798 786 if(_highlightNode == NullFC) 799 787 { 800 GeoUInt8Property Ptr type = GeoUInt8Property::create();788 GeoUInt8PropertyRefPtr type = GeoUInt8Property::create(); 801 789 GeoUInt8Property::StoredFieldType* t = type->editFieldPtr(); 802 790 t->push_back(GL_LINE_STRIP); 803 791 t->push_back(GL_LINES); 804 792 805 GeoUInt32Property Ptr lens = GeoUInt32Property::create();793 GeoUInt32PropertyRefPtr lens = GeoUInt32Property::create(); 806 794 GeoUInt32Property::StoredFieldType* l = lens->editFieldPtr(); 807 795 l->push_back(10); 808 796 l->push_back(6); 809 797 810 GeoUInt32Property Ptr index = OSG::GeoUInt32Property::create();798 GeoUInt32PropertyRefPtr index = OSG::GeoUInt32Property::create(); 811 799 GeoUInt32Property::StoredFieldType* idx = index->editFieldPtr(); 812 800 idx->push_back(0); … … 839 827 p->push_back(Pnt3f( 1, 1, 1)); 840 828 841 Geometry Ptr geo = Geometry::create();829 GeometryRefPtr geo = Geometry::create(); 842 830 geo->setTypes (type); 843 831 geo->setLengths (lens); … … 845 833 geo->setPositions (_highlightPoints); 846 834 geo->setMaterial (_highlightMaterial); 847 addRef(geo);848 835 849 836 _highlightNode = Node::create(); 850 837 _highlightNode->setCore(geo); 851 addRef(_highlightNode);852 838 } 853 839 branches/Carsten_PtrWork2/Source/System/Window/Utilities/OSGSimpleSceneManager.h
r1004 r1035 202 202 /*! \{ */ 203 203 204 WindowPtr _win; 205 NodePtr _root; 206 207 ImageForegroundPtr _foreground; 208 StatisticsForegroundPtr _statforeground; 209 bool _statstate; 210 211 NodePtr _highlight; 212 NodePtr _highlightNode; 213 //GeoPositions3fPtr _highlightPoints; 214 GeoPnt3fPropertyPtr _highlightPoints; 215 216 NodePtr _internalRoot; 217 DirectionalLightPtr _headlight; 204 WindowRefPtr _win; 205 NodeRefPtr _root; 206 207 ImageForegroundRefPtr _foreground; 208 StatisticsForegroundRefPtr _statforeground; 209 bool _statstate; 210 211 NodeRefPtr _highlight; 212 NodeRefPtr _highlightNode; 213 GeoPnt3fPropertyRefPtr _highlightPoints; 214 215 NodeRefPtr _internalRoot; 216 DirectionalLightRefPtr _headlight; 218 217 #ifdef OSG_OLD_RENDER_ACTION 219 RenderAction * _renderAction; /**< The RenderAction to use if using RenderActions. */220 RenderAction * _ownAction;218 RenderAction * _renderAction; /**< The RenderAction to use if using RenderActions. */ 219 RenderAction * _ownAction; 221 220 #endif 222 221 223 222 /** The RenderAction to use if using render traversals. */ 224 RenderAction * _rtaction;225 226 Transform Ptr _cart;227 PerspectiveCamera Ptr _camera;228 229 Navigator _navigator;230 231 Int16 _lastx;232 Int16 _lasty;233 UInt16 _mousebuttons;234 235 bool _traversalAction;236 237 static SimpleMaterial Ptr _highlightMaterial;223 RenderAction * _rtaction; 224 225 TransformRefPtr _cart; 226 PerspectiveCameraRefPtr _camera; 227 228 Navigator _navigator; 229 230 Int16 _lastx; 231 Int16 _lasty; 232 UInt16 _mousebuttons; 233 234 bool _traversalAction; 235 236 static SimpleMaterialRefPtr _highlightMaterial; 238 237 239 238 /*! \} */ branches/Carsten_PtrWork2/Tutorials/01hello.cpp
r835 r1035 46 46 47 47 // the connection between GLUT and OpenSG 48 GLUTWindow Ptr gwin= GLUTWindow::create();48 GLUTWindowRefPtr gwin = GLUTWindow::create(); 49 49 gwin->setGlutId(winid); 50 50 gwin->init(); 51 51 52 52 // create the scene 53 Node Ptr scene = makeTorus(.5, 2, 16, 16);53 NodeRefPtr scene = makeTorus(.5, 2, 16, 16); 54 54 55 55 commitChanges(); … … 78 78 void display(void) 79 79 { 80 std::cerr << "-- BEGIN Frame --" << std::endl; 81 80 82 mgr->redraw(); 83 84 std::cerr << "-- END Frame --" << std::endl; 81 85 } 82 86 branches/Carsten_PtrWork2/Tutorials/02move.cpp
r835 r1035 24 24 25 25 // The pointer to the transformation 26 Transform Ptr trans;26 TransformRefPtr trans; 27 27 28 28 … … 65 65 66 66 // the connection between GLUT and OpenSG 67 GLUTWindow Ptr gwin= GLUTWindow::create();67 GLUTWindowRefPtr gwin= GLUTWindow::create(); 68 68 gwin->setGlutId(winid); 69 69 gwin->init(); … … 71 71 // create the scene 72 72 73 Node Ptr torus = makeTorus( .5, 2, 16, 32 );73 NodeRefPtr torus = makeTorus( .5, 2, 16, 32 ); 74 74 75 75 // create the transformation node … … 77 77 78 78 // 1. create the Node 79 Node Ptr scene = Node::create();79 NodeRefPtr scene = Node::create(); 80 80 81 81 // 2. create the core
