Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::Inport Class Referenceabstract

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>

+ Inheritance diagram for inviwo::Inport:

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 OutportgetConnectedOutport () 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
 
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>
 
virtual std::string getClassIdentifier () const =0
 
virtual glm::uvec3 getColorCode () const =0
 
virtual Document getInfo () const =0
 
const DocumentgetHelp () const
 
DocumentgetHelp ()
 
PortsetHelp (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_
 
Processorprocessor_
 
Document help_
 

Friends

class Outport
 
class Processor
 
class ProcessorNetwork
 
class ProcessorNetworkEvaluator
 

Detailed Description

Abstract base class for all inports An Inport can be connected to an Outport. The approved connection can be determined by the canConnectTo function.

Member Function Documentation

◆ invalidate()

virtual void inviwo::Inport::invalidate ( InvalidationLevel invalidationLevel)
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.

◆ isChanged()

virtual bool inviwo::Inport::isChanged ( ) const
virtual

An inport is changed when it has new data, and it's processor has not been processed.

◆ isConnected()

virtual bool inviwo::Inport::isConnected ( ) const
overridevirtual

Implements inviwo::Port.

◆ isReady()

virtual bool inviwo::Inport::isReady ( ) const
overridevirtual

An inport is ready when it is connected, and it's outports are ready.

See also
Outport::isReady

Implements inviwo::Port.

◆ onChange()

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.

◆ onInvalid()

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.

◆ propagateEvent()

virtual void inviwo::Inport::propagateEvent ( Event * event,
Outport * target = nullptr )
virtual

Propagate event upwards towards connected outports, if targets is nullptr, propagate the even to all connected outport, otherwise only to target.

◆ readyUpdate()

void inviwo::Inport::readyUpdate ( )

Called by the connected outports to let the inport know that their ready status has changed.

◆ setOptional()

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.

See also
isReady

◆ setValid()

virtual void inviwo::Inport::setValid ( const Outport * source)
protectedvirtual

Called by Outport::setValid, which is call by Processor::setValid, which is called after Processor:process. From above in the network.


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