Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::BrushingAndLinkingInport Class Reference

#include <brushingandlinkingports.h>

+ Inheritance diagram for inviwo::BrushingAndLinkingInport:

Public Types

using type = void
 

Public Member Functions

void setInvalidationLevels (std::vector< BrushingTargetsInvalidationLevel > invalidationLevels)
 
BrushingAndLinkingManagergetManager ()
 
const BrushingAndLinkingManagergetManager () const
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 
virtual bool canConnectTo (const Port *port) const override
 
virtual size_t getMaxNumberOfConnections () const override
 
virtual std::string getClassIdentifier () const override
 
virtual glm::uvec3 getColorCode () const override
 
virtual Document getInfo () const override
 
- Public Member Functions inherited from inviwo::Inport
virtual bool isConnected () const override
 
virtual bool isReady () const override
 
void setOptional (bool optional)
 
bool isOptional () const
 
virtual bool isChanged () const
 
virtual void connectTo (Outport *outport)
 
virtual void disconnectFrom (Outport *outport)
 
virtual bool isConnectedTo (const Outport *outport) const
 
virtual OutportgetConnectedOutport () const
 
virtual const std::vector< Outport * > & getConnectedOutports () const
 
virtual size_t getNumberOfConnections () const
 
virtual const std::vector< const Outport * > & getChangedOutports () const
 
virtual void propagateEvent (Event *event, Outport *target=nullptr)
 
const BaseCallBack * onChange (std::function< void()> lambda)
 
std::shared_ptr< std::function< void()> > onChangeScoped (std::function< void()> lambda)
 
const BaseCallBack * onInvalid (std::function< void()> lambda)
 
std::shared_ptr< std::function< void()> > onInvalidScoped (std::function< void()> lambda)
 
const BaseCallBack * onConnect (std::function< void()> lambda)
 
const BaseCallBack * onDisconnect (std::function< void()> lambda)
 
std::shared_ptr< std::function< void()> > onConnectScoped (std::function< void()> lambda)
 
std::shared_ptr< std::function< void()> > onDisconnectScoped (std::function< void()> lambda)
 
std::shared_ptr< std::function< void(Outport *)> > onConnectScoped (std::function< void(Outport *)> lambda)
 
std::shared_ptr< std::function< void(Outport *)> > onDisconnectScoped (std::function< void(Outport *)> lambda)
 
void removeOnChange (const BaseCallBack *callback)
 
void removeOnInvalid (const BaseCallBack *callback)
 
void removeOnConnect (const BaseCallBack *callback)
 
void removeOnDisconnect (const BaseCallBack *callback)
 
void readyUpdate ()
 
void setIsReadyUpdater (std::function< bool()> updater)
 
- Public Member Functions inherited from inviwo::Port
 Port (const Port &)=delete
 
Portoperator= (const Port &)=delete
 
 Port (Port &&)=delete
 
Portoperator= (Port &&)=delete
 
const std::string & getIdentifier () const
 
void setIdentifier (const std::string &name)
 
ProcessorgetProcessor () const
 
std::string getPath () const
 Get the port path i.e. <processor identifier>.<port identifier>
 
const DocumentgetHelp () const
 
DocumentgetHelp ()
 
PortsetHelp (Document help)
 
- Public Member Functions inherited from inviwo::Serializable

Protected Member Functions

virtual void invalidate (InvalidationLevel invalidationLevel) override
 
- Protected Member Functions inherited from inviwo::Inport
 Inport (std::string_view identifier, Document help)
 
bool circularConnection (const Port *port) const
 
virtual void setValid (const Outport *source)
 
void callOnChangeIfChanged () const
 
- Protected Member Functions inherited from inviwo::Port
 Port (std::string_view identifier, Document help)
 
void setProcessor (Processor *processor)
 

Friends

class BrushingAndLinkingManager
 

Additional Inherited Members

- Protected Attributes inherited from inviwo::Inport
StateCoordinator< bool > isReady_
 
StateCoordinator< bool > isOptional_
 
std::vector< Outport * > connectedOutports_
 
- Protected Attributes inherited from inviwo::Port
std::string identifier_
 
Processorprocessor_
 
Document help_
 

Detailed Description

Enables selection/filtering/highlighting between processors. The inport has it's own BrushingManager and therefore does not need to be connected to a BrushingAndLinkingOutport to be valid.

Use setInvalidationLevels if you only want Processor::process to be called for a subset of brushing targets or actions. Use getModifiedActions if you want to know which BrushingModifications caused a Processor::process call.

See also
BrushingAndLinkingManager

Member Function Documentation

◆ canConnectTo()

virtual bool inviwo::BrushingAndLinkingInport::canConnectTo ( const Port * port) const
overridevirtual

Implements inviwo::Inport.

◆ deserialize()

virtual void inviwo::BrushingAndLinkingInport::deserialize ( Deserializer & d)
overridevirtual

Reimplemented from inviwo::Port.

◆ getClassIdentifier()

virtual std::string inviwo::BrushingAndLinkingInport::getClassIdentifier ( ) const
overridevirtual

Implements inviwo::Port.

◆ getColorCode()

virtual glm::uvec3 inviwo::BrushingAndLinkingInport::getColorCode ( ) const
inlineoverridevirtual

Returns the RGB color code used to colorize all ports of this type. This color code is for instance used in the NetworkEditor. To distinguish different port types through their color, this method should be overloaded in derived classes.

Implements inviwo::Port.

◆ getInfo()

virtual Document inviwo::BrushingAndLinkingInport::getInfo ( ) const
overridevirtual

This function should describe the state of the port and the data it holds. Derived ports should extend this function and add information about their state. The port help is usually included in this information. The description is usually shown as a tooltip in the GUI.

Implements inviwo::Port.

◆ getMaxNumberOfConnections()

virtual size_t inviwo::BrushingAndLinkingInport::getMaxNumberOfConnections ( ) const
inlineoverridevirtual

Implements inviwo::Inport.

◆ invalidate()

virtual void inviwo::BrushingAndLinkingInport::invalidate ( InvalidationLevel invalidationLevel)
overrideprotectedvirtual

Called by Outport::invalidate on its connected inports, which is call by Processor::invalidate. Will by default invalidate its processor. From above in the network.

Reimplemented from inviwo::Inport.

◆ serialize()

virtual void inviwo::BrushingAndLinkingInport::serialize ( Serializer & s) const
overridevirtual

Reimplemented from inviwo::Port.

◆ setInvalidationLevels()

void inviwo::BrushingAndLinkingInport::setInvalidationLevels ( std::vector< BrushingTargetsInvalidationLevel > invalidationLevels)

Inport constructor for BrushingAndLinkingManager.

// Only invalidate processor on row filtering and column selection.
{
{{BrushingTarget::Row}, BrushingModification::Filtered, InvalidationLevel::InvalidOutput},
{{BrushingTarget::Column}, BrushingModification::Selected,
InvalidationLevel::InvalidOutput}
}
);
// Invalidate processor on filtering or selection for any target.
BrushingAndLinkingInport("brushing",
{
{BrushingAndLinkingManager::AnyBrushingTarget, BrushingModification::Filtered |
BrushingModification::Selected, InvalidationLevel::InvalidOutput}
}
);
@param identifier of port.
@param invalidationLevels for brushing targets and actions that should invalidate the
processor (Processor::process will be called for those). Defaults to InvalidOutput for all
targets (Row, Column) and all actions (filtering/selection/highlight).
/
BrushingAndLinkingInport(std::string_view identifier,
std::vector<BrushingTargetsInvalidationLevel> invalidationLevels = {
BrushingModifications(flags::any),
InvalidationLevel::InvalidOutput}});
BrushingAndLinkingInport(std::string_view identifier, Document help,
std::vector<BrushingTargetsInvalidationLevel> invalidationLevels = {
BrushingModifications(flags::any),
InvalidationLevel::InvalidOutput}});
virtual ~BrushingAndLinkingInport() = default;
virtual bool isChanged() const override;
BrushingModifications getModifiedActions() const;
bool isFilteringModified() const;
bool isSelectionModified() const;
bool isHighlightModified() const;
void brush(BrushingAction action, BrushingTarget target, const BitSet& indices,
std::string_view source = {});
void filter(std::string_view source, const BitSet& indices,
BrushingTarget target = BrushingTarget::Row);
void select(const BitSet& indices, BrushingTarget target = BrushingTarget::Row);
void highlight(const BitSet& indices, BrushingTarget target = BrushingTarget::Row);
// clang-format off
[[deprecated("use brush() or filter() instead")]] void sendFilterEvent(const BitSet& indices, std::string_view source);
[[deprecated("use brush() or select() instead")]] void sendSelectionEvent(const BitSet& indices);
[[deprecated("use brush() or select() with a column target instead")]] void sendColumnSelectionEvent(const BitSet& indices);
// clang-format on
bool isFiltered(uint32_t idx, BrushingTarget target = BrushingTarget::Row) const;
bool isSelected(uint32_t idx, BrushingTarget target = BrushingTarget::Row) const;
bool isHighlighted(uint32_t idx, BrushingTarget target = BrushingTarget::Row) const;
// clang-format off
[[deprecated("use isSelected() with a column target instead")]] bool isColumnSelected(uint32_t idx) const;
// clang-format on
const BitSet& getIndices(BrushingAction action,
BrushingTarget target = BrushingTarget::Row) const;
const BitSet& getFilteredIndices(BrushingTarget target = BrushingTarget::Row) const;
const BitSet& getSelectedIndices(BrushingTarget target = BrushingTarget::Row) const;
const BitSet& getHighlightedIndices(BrushingTarget target = BrushingTarget::Row) const;
// clang-format off
[[deprecated("use getIndices() or getSelectedIndices() with a column target instead")]] const BitSet& getSelectedColumns() const;
// clang-format on
const std::vector<BrushingTargetsInvalidationLevel>& getInvalidationLevels() const;
Definition brushingandlinkingports.h:69
virtual void invalidate(InvalidationLevel invalidationLevel) override
static const std::vector< BrushingTarget > AnyBrushingTarget
Helper for invalidation level initialization.
Definition brushingandlinkingmanager.h:103
virtual bool isChanged() const
virtual void process()
Definition processor.h:307
IVW_CORE_API bool isSelected(const Processor *processor)
BrushingAction
Definition brushingaction.h:54

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