1 | #pragma once |
---|
2 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer |
---|
3 | * |
---|
4 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
5 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
6 | * (at your option) any later version. The full license is in LICENSE file |
---|
7 | * included with this distribution, and on the openscenegraph.org website. |
---|
8 | * |
---|
9 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
10 | * You have to aquire licenses for all used proprietary modules. |
---|
11 | * |
---|
12 | * This library is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * OpenSceneGraph Public License for more details. |
---|
16 | * |
---|
17 | * This file is based on the OSG example of the Silverlining SDK: |
---|
18 | * Copyright (c) 2008 Sundog Software, LLC. All rights reserved worldwide. |
---|
19 | */ |
---|
20 | |
---|
21 | #include <osg/Drawable> |
---|
22 | #include <osgViewer/Viewer> |
---|
23 | #include <SilverLining.h> |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | //class SilverLining::Atmosphere; |
---|
28 | class Atmosphere; |
---|
29 | |
---|
30 | namespace osgVisual |
---|
31 | { |
---|
32 | /** |
---|
33 | * \brief This class wraps Silverlining's endFrame() function which render clouds, fog and finishes the frame. |
---|
34 | * |
---|
35 | * @author Torben Dannhauer |
---|
36 | * @date Sep 2009 |
---|
37 | */ |
---|
38 | class skySilverLining_cloudsDrawable : public osg::Drawable |
---|
39 | { |
---|
40 | #include <leakDetection.h> |
---|
41 | public: |
---|
42 | /** |
---|
43 | * \brief Constructor : Initializes attributes. |
---|
44 | * |
---|
45 | */ |
---|
46 | skySilverLining_cloudsDrawable(); |
---|
47 | |
---|
48 | /** |
---|
49 | * \brief Constructor : Initializes attributes. |
---|
50 | * |
---|
51 | * @param view : Pointer to the viewer instance. |
---|
52 | */ |
---|
53 | skySilverLining_cloudsDrawable(osgViewer::Viewer* view); |
---|
54 | |
---|
55 | /** |
---|
56 | * \brief This function checks if this object is the same kind as the specified one. |
---|
57 | * |
---|
58 | * This function is required by subclassing osg::Drawable. |
---|
59 | * |
---|
60 | * @param obj : object to compare this type to. |
---|
61 | * @return : True if it is the same kind. |
---|
62 | */ |
---|
63 | virtual bool isSameKindAs(const Object* obj) const { |
---|
64 | return dynamic_cast<const skySilverLining_cloudsDrawable*>(obj)!=NULL; |
---|
65 | } |
---|
66 | |
---|
67 | /** |
---|
68 | * \brief This function clones this class/type. |
---|
69 | * |
---|
70 | * This function is required by subclassing osg::Drawable. |
---|
71 | * |
---|
72 | * @return : Cloned instance. |
---|
73 | */ |
---|
74 | virtual Object* cloneType() const { |
---|
75 | return new skySilverLining_cloudsDrawable(); |
---|
76 | } |
---|
77 | |
---|
78 | /** |
---|
79 | * \brief This function clones this class/type. |
---|
80 | * |
---|
81 | * This function is required by subclassing osg::Drawable. |
---|
82 | * |
---|
83 | * @param copyop : Copy operator flag which indicates how to clone. |
---|
84 | * @return : Cloned instance. |
---|
85 | */ |
---|
86 | virtual Object* clone(const osg::CopyOp& copyop) const { |
---|
87 | return new skySilverLining_cloudsDrawable(); |
---|
88 | } |
---|
89 | |
---|
90 | /** |
---|
91 | * \brief Draw implementation which will be drawn every frame and is the true payload of thes class. |
---|
92 | * |
---|
93 | * @param renderInfo : rendering information.. (?) |
---|
94 | */ |
---|
95 | virtual void drawImplementation(osg::RenderInfo& renderInfo) const; |
---|
96 | |
---|
97 | protected: |
---|
98 | /** |
---|
99 | * Pointer to the viewer instance. |
---|
100 | */ |
---|
101 | osgViewer::Viewer* _view; |
---|
102 | }; |
---|
103 | |
---|
104 | } // END NAMESPACE |
---|