Inviwo 0.9.12-pre
Inviwo documentation
|
Abstract base class for all inports An Inport can be connected to an Outport. The approved connection can be determined by the canConnectTo function. More...
#include <inport.h>
Public Member Functions | |
virtual bool | isConnected () const override |
virtual bool | isReady () const override |
void | setOptional (bool optional) |
bool | isOptional () const |
virtual bool | isChanged () const |
virtual bool | canConnectTo (const Port *port) const =0 |
virtual void | connectTo (Outport *outport) |
virtual void | disconnectFrom (Outport *outport) |
virtual bool | isConnectedTo (const Outport *outport) const |
virtual Outport * | getConnectedOutport () const |
virtual const std::vector< Outport * > & | getConnectedOutports () const |
virtual size_t | getMaxNumberOfConnections () const =0 |
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 | |
Port & | operator= (const Port &)=delete |
Port (Port &&)=delete | |
Port & | operator= (Port &&)=delete |
const std::string & | getIdentifier () const |
void | setIdentifier (const std::string &name) |
Processor * | getProcessor () const |
std::string | getPath () const |
Get the port path i.e. <processor identifier>.<port identifier> | |
virtual std::string | getClassIdentifier () const =0 |
virtual glm::uvec3 | getColorCode () const =0 |
virtual Document | getInfo () const =0 |
const Document & | getHelp () const |
Document & | getHelp () |
Port & | setHelp (Document help) |
virtual void | serialize (Serializer &s) const override |
virtual void | deserialize (Deserializer &d) override |
Public Member Functions inherited from inviwo::Serializable |
Protected Member Functions | |
Inport (std::string_view identifier, Document help) | |
bool | circularConnection (const Port *port) const |
virtual void | invalidate (InvalidationLevel invalidationLevel) |
virtual void | setValid (const Outport *source) |
virtual void | setChanged (bool changed=true, const Outport *source=nullptr) |
void | callOnChangeIfChanged () const |
Protected Member Functions inherited from inviwo::Port | |
Port (std::string_view identifier, Document help) | |
void | setProcessor (Processor *processor) |
Protected Attributes | |
StateCoordinator< bool > | isReady_ |
StateCoordinator< bool > | isOptional_ |
std::vector< Outport * > | connectedOutports_ |
Protected Attributes inherited from inviwo::Port | |
std::string | identifier_ |
Processor * | processor_ |
Document | help_ |
Friends | |
class | Outport |
class | Processor |
class | ProcessorNetwork |
class | ProcessorNetworkEvaluator |
Abstract base class for all inports An Inport can be connected to an Outport. The approved connection can be determined by the canConnectTo function.
|
protectedvirtual |
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 in inviwo::BrushingAndLinkingInport.
|
virtual |
An inport is changed when it has new data, and it's processor has not been processed.
|
overridevirtual |
Implements inviwo::Port.
|
overridevirtual |
An inport is ready when it is connected, and it's outports are ready.
Implements inviwo::Port.
const BaseCallBack * inviwo::Inport::onChange | ( | std::function< void()> | lambda | ) |
The on change call back is invoked before Processor::process after a port has been connected, disconnected, or has changed its validation level. Note it is only called if process is also going to be called.
const BaseCallBack * inviwo::Inport::onInvalid | ( | std::function< void()> | lambda | ) |
the onInvalid callback is called directly after the port has been invalidated. It's only called once for each transition from valid to invalid.
Propagate event upwards towards connected outports, if targets is nullptr, propagate the even to all connected outport, otherwise only to target.
void inviwo::Inport::readyUpdate | ( | ) |
Called by the connected outports to let the inport know that their ready status has changed.
void inviwo::Inport::setOptional | ( | bool | optional | ) |
An inport can be set optional, in which case the processor will by default be ready even if no outport is connected. This means that an optional inport may not have any connected outports when evaluating the ProcessorNetwork, i.e. when Processor::process() is called. Hence one needs to check manually that the port isReady before using it.
|
protectedvirtual |
Called by Outport::setValid, which is call by Processor::setValid, which is called after Processor:process. From above in the network.