Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::DataInport< T, N, Flat > Class Template Reference

#include <datainport.h>

+ Inheritance diagram for inviwo::DataInport< T, N, Flat >:

Public Types

using type = T
 
using value_type = std::shared_ptr<const T>
 

Public Member Functions

 DataInport (std::string_view identifier, Document help={})
 
virtual std::string getClassIdentifier () const override
 
virtual uvec3 getColorCode () const override
 
virtual Document getInfo () const override
 
virtual size_t getMaxNumberOfConnections () const override
 
virtual bool canConnectTo (const Port *port) const override
 
virtual void connectTo (Outport *port) override
 
virtual bool isConnected () const override
 
virtual std::shared_ptr< const T > getData () const
 
virtual std::vector< std::shared_ptr< const T > > getVectorData () const
 
virtual std::vector< std::pair< Outport *, std::shared_ptr< const T > > > getSourceVectorData () const
 
virtual bool hasData () const
 
- Public Member Functions inherited from inviwo::Inport
virtual bool isReady () const override
 
void setOptional (bool optional)
 
bool isOptional () const
 
virtual bool isChanged () const
 
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)
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 
- Public Member Functions inherited from inviwo::Serializable
- Public Member Functions inherited from inviwo::InportIterable< DataInport< T, 1, false >, T, false >
util::iter_range< const_iterator_port > outportAndData () const
 
util::iter_range< const_iterator_changed > changedAndData () const
 
const_iterator begin () const
 
const_iterator end () const
 

Static Public Attributes

static constexpr bool flattenData = Flat
 
static constexpr size_t maxConnections = N
 

Additional Inherited Members

- Protected Member Functions inherited from inviwo::Inport
 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 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

template<typename T, size_t N = 1, bool Flat = false>
class inviwo::DataInport< T, N, Flat >

DataInport represents a general inport providing data as a std:shared_ptr<const T> If N is set to 0 the port will accept multiple connections, and will provide a std::vector<std::shared_ptr<const T>> of data. If N is larger then 1 exactly that many connections are accepted. If Flat is set to true, the inport will also accept connections from outport with vector data of type T and merge them into the data return data vector.

Member Function Documentation

◆ canConnectTo()

template<typename T , size_t N, bool Flat>
bool inviwo::DataInport< T, N, Flat >::canConnectTo ( const Port * port) const
overridevirtual

Implements inviwo::Inport.

◆ connectTo()

template<typename T , size_t N, bool Flat>
void inviwo::DataInport< T, N, Flat >::connectTo ( Outport * port)
overridevirtual

Reimplemented from inviwo::Inport.

◆ getClassIdentifier()

template<typename T , size_t N, bool Flat>
std::string inviwo::DataInport< T, N, Flat >::getClassIdentifier ( ) const
overridevirtual

Implements inviwo::Port.

◆ getColorCode()

template<typename T , size_t N, bool Flat>
uvec3 inviwo::DataInport< T, N, Flat >::getColorCode ( ) const
overridevirtual

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()

template<typename T , size_t N, bool Flat>
Document inviwo::DataInport< T, N, Flat >::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.

Reimplemented in inviwo::BaseImageInport< size_t >, inviwo::BaseImageInport< 0 >, and inviwo::BaseImageInport< 1 >.

◆ getMaxNumberOfConnections()

template<typename T , size_t N, bool Flat>
size_t inviwo::DataInport< T, N, Flat >::getMaxNumberOfConnections ( ) const
overridevirtual

Implements inviwo::Inport.

◆ isConnected()

template<typename T , size_t N, bool Flat>
bool inviwo::DataInport< T, N, Flat >::isConnected ( ) const
overridevirtual

Reimplemented from inviwo::Inport.


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