The Vish Visualization Shell 0.3
Vish
Wizt::Brush Struct Reference

A data-driven description of a Brush to select points from a set of points, providing an list of indices. More...

#include <ocean/Anemonia/Brush.hpp>

Classes

struct  Metric
 For analytical shapes of a brush, allows to model spheres, ellipsoids, ellipses, cylinders... More...

Public Member Functions

RefPtr< Eagle::BoundingBoxcomputeBoundingBoxInScreenOverlaySpace () const
 The shape of the brush extruded in depth, given in overlay coordinates on the screen.
RefPtr< Eagle::BoundingBoxcomputeBoundingBoxInWorldSpace () const
 The bounding box of the brush as it appears in world coordinates which will naturally have larger volume than in screen space to encompass perspective effects.
PointDataChunk getBrushInWorldSpace (double screen_depth) const
 Get the selection polygon in world space using the current view with screen depth between 0.0 (front cutoff of the view volume) and 1.0 (back cutoff of the view volume).
RefPtr< Chunk< size_t > > getSelection (const RefPtr< Chunk< Eagle::PhysicalSpace::point > > &WorldCoordinates, const std::function< bool(Eagle::PhysicalSpace::point)> &RegionOfInterest) const
 The core function: Given a chunk of world coordinates, determine the indices of the points that are selected by this brush (the polygon coordinates and the projection in ScreenView ).
 operator bool () const
 Check whether this Brush is valid.
bool operator! () const
 Check whether this Brush is invalid.

Static Public Member Functions

static void connectBrushAsInput (VObject *Owner, TypedSlot< Brush > &inBrush, const string &BrushCreatorName="Brush")
 To automatically connect a Brush instance to a VObject that uses a brush, call this function in the constructor of the respective VObject.

Public Attributes

PointDataChunk PolygonOnScreen
 Points of the brush outline in OverlayCoordinate.

Detailed Description

A data-driven description of a Brush to select points from a set of points, providing an list of indices.

Call Brush::connectBrushAsInput() in a VObject using a Brush as input to automatically have it connect to an existing Brush instance or to create one if none exists yet.

Member Function Documentation

◆ computeBoundingBoxInScreenOverlaySpace()

RefPtr< BoundingBox > Wizt::Brush::computeBoundingBoxInScreenOverlaySpace ( ) const

The shape of the brush extruded in depth, given in overlay coordinates on the screen.

Don't confuse with pointer coordinates on the screen, use OverlayToPointer() to convert into pointer coordinates.

References Eagle::norm(), Eagle::P0(), Eagle::P1(), and PolygonOnScreen.

Referenced by computeBoundingBoxInWorldSpace().

◆ connectBrushAsInput()

void Wizt::Brush::connectBrushAsInput ( VObject * Owner,
TypedSlot< Brush > & inBrush,
const string & BrushCreatorName = "Brush" )
static

To automatically connect a Brush instance to a VObject that uses a brush, call this function in the constructor of the respective VObject.

If no Brush exists yet, it will be created.

This function utilites the VObject::addSetup() function to find a unique object that provides a Brush, and if found, attaches it as input, otherwise it creates a new object fitting the Brush, equivalent to the following code segment:

Owner->addSetup( [Owner, BrushCreatorName, &inBrush](const VObject::CreationSlots_t&)
{
if (RefPtr<VParameter> haveBrush = Owner->findUniqueOutputObject( typeid(Brush) ) )
Owner->attach( inBrush->getParameter() , haveBrush);
else
Owner->attachNewObject(inBrush, BrushCreatorName );
}
);
VSlotSet CreationSlots_t
A set of slots.
Definition VSlotContainer.hpp:237
StrongPtr< Object, ObjectBase > RefPtr
Convenience template typedef to use RefPtr instead of StrongPtr.
Definition RefPtr.hpp:776
A data-driven description of a Brush to select points from a set of points, providing an list of indi...
Definition Brush.hpp:28

References Wizt::VConnectable::attach(), Wizt::VObject::attachNewObject(), and Wizt::VObject::findUniqueOutputObject().

◆ getSelection()

RefPtr< Chunk< size_t > > Wizt::Brush::getSelection ( const RefPtr< Chunk< Eagle::PhysicalSpace::point > > & WorldCoordinates,
const std::function< bool(Eagle::PhysicalSpace::point)> & RegionOfInterest ) const

The core function: Given a chunk of world coordinates, determine the indices of the points that are selected by this brush (the polygon coordinates and the projection in ScreenView ).

An optional arbitrary function to constrain the region of interest may be specified additionally.

References PolygonOnScreen.