scg3  0.6
Shape.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright 2014 Volker Ahlers
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 
25 #ifndef SHAPE_H_
26 #define SHAPE_H_
27 
28 #include "Leaf.h"
29 #include "scg_internals.h"
30 
31 namespace scg {
32 
33 
42 class Shape: public Leaf {
43 
44 public:
45 
49  Shape();
50 
54  Shape(GeometryCoreSP geometryCore);
55 
59  virtual ~Shape();
60 
64  static ShapeSP create();
65 
69  static ShapeSP create(GeometryCoreSP geometryCore);
70 
81  Shape* addCore(CoreSP core);
82 
87 
91  int getNTriangles() const;
92 
96  virtual void accept(Traverser* traverser);
97 
101  virtual void render(RenderState* renderState);
102 
103 };
104 
105 
106 } /* namespace scg */
107 
108 #endif /* SHAPE_H_ */
virtual void render(RenderState *renderState)
int getNTriangles() const
Base class for all leaf nodes, i.e., nodes without children (composite pattern, abstract).
A core that contains geometry information to be rendered.
Definition: GeometryCore.h:53
static ShapeSP create()
Base class for all leaf nodes, i.e., nodes without children (composite pattern, abstract).
Definition: Leaf.h:36
Base class for all cores (abstract).
Definition: Core.h:36
Base class for all traversers (visitor pattern, abstract).
Definition: Traverser.h:36
2D texture core.
Definition: Texture2DCore.h:39
A shape node that contains geometry to be rendered (leaf node).
Definition: Shape.h:42
virtual ~Shape()
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
Definition: Animation.h:28
Shape * addCore(CoreSP core)
Internal definitions required by most classes.
void addTextureCore(Texture2DCoreSP core)
virtual void accept(Traverser *traverser)