Beatmup
Beatmup::Scene::SceneLayer Class Reference

Layer containing an entire scene. More...

#include <scene.h>

Inheritance diagram for Beatmup::Scene::SceneLayer:
Beatmup::Scene::Layer Beatmup::Object

Public Member Functions

const Beatmup::ScenegetScene () const
 
bool testPoint (float x, float y) const
 Tests if a given point falls in the layer. More...
 
LayergetChild (float x, float y, unsigned int recursionDepth=0) const
 Picks a child layer at given point, if any. More...
 
- Public Member Functions inherited from Beatmup::Scene::Layer
Type getType () const
 
const std::string & getName () const
 
void setName (const char *name)
 
AffineMappinggetMapping ()
 
const AffineMappinggetMapping () const
 
void setMapping (const AffineMapping &mapping)
 
bool isVisible () const
 Returns layer visibility flag. More...
 
bool isPhantom () const
 Returns true if the layer is ignored when searching a layer by point. More...
 
void setVisible (bool visible)
 Sets layer visibility. More...
 
void setPhantom (bool phantom)
 Makes/unmakes the layer "phantom". More...
 
template<class LayerType >
LayerType & castTo () const
 
- Public Member Functions inherited from Beatmup::Object
virtual ~Object ()
 

Private Member Functions

 SceneLayer (const Beatmup::Scene &scene)
 

Private Attributes

const Beatmup::Scenescene
 

Friends

class Scene
 

Additional Inherited Members

- Public Types inherited from Beatmup::Scene::Layer
enum class  Type {
  SceneLayer = 0 , BitmapLayer , MaskedBitmapLayer , ShapedBitmapLayer ,
  ShadedBitmapLayer
}
 
- Protected Member Functions inherited from Beatmup::Scene::Layer
 Layer (Type type)
 
virtual void render (RenderingContext &context)
 
- Protected Attributes inherited from Beatmup::Scene::Layer
AffineMapping mapping
 layer mapping More...
 
bool visible
 layer visibility More...
 
bool phantom
 if true, layer is ignored by selection by point More...
 

Detailed Description

Layer containing an entire scene.

Definition at line 141 of file scene.h.

Constructor & Destructor Documentation

◆ SceneLayer()

Scene::SceneLayer::SceneLayer ( const Beatmup::Scene scene)
private

Definition at line 249 of file scene.cpp.

@ SceneLayer
layer containing a scene
Layer(const Layer &)=delete
disabling copying constructor
const Beatmup::Scene & scene
Definition: scene.h:144

Member Function Documentation

◆ getScene()

const Beatmup::Scene& Beatmup::Scene::SceneLayer::getScene ( ) const
inline

Definition at line 147 of file scene.h.

147 { return scene; }

◆ testPoint()

bool Scene::SceneLayer::testPoint ( float  x,
float  y 
) const
virtual

Tests if a given point falls in the layer.

Reimplemented from Beatmup::Scene::Layer.

Definition at line 251 of file scene.cpp.

251  {
252  return getChild(x, y) != nullptr;
253 }
Layer * getChild(float x, float y, unsigned int recursionDepth=0) const
Picks a child layer at given point, if any.
Definition: scene.cpp:255
jobject jlong jint jint y
jobject jlong jint x

◆ getChild()

Scene::Layer * Scene::SceneLayer::getChild ( float  x,
float  y,
unsigned int  recursionDepth = 0 
) const
virtual

Picks a child layer at given point, if any.

Reimplemented from Beatmup::Scene::Layer.

Definition at line 255 of file scene.cpp.

255  {
256  static const unsigned int MAX_RECURSION_DEPTH = 256;
257  if (recursionDepth >= MAX_RECURSION_DEPTH)
258  return nullptr;
259  Point p = mapping.getInverse(x, y);
260  return scene.getLayer(p.x, p.y, recursionDepth);
261 }
AffineMapping getInverse() const
Returns inverse mapping.
Definition: geometry.cpp:52
AffineMapping mapping
layer mapping
Definition: scene.h:80
Layer * getLayer(const char *name) const
Retrieves a layer by its name or null if not found.
Definition: scene.cpp:163
Beatmup::IntPoint p((int) x,(int) y)

Friends And Related Function Documentation

◆ Scene

friend class Scene
friend

Definition at line 142 of file scene.h.

Member Data Documentation

◆ scene

const Beatmup::Scene& Beatmup::Scene::SceneLayer::scene
private

Definition at line 144 of file scene.h.


The documentation for this class was generated from the following files: