Drake
GeometryContext< T > Class Template Referencefinal

The custom leaf context type for SceneGraph. More...

#include <geometry/geometry_context.h>

Inheritance diagram for GeometryContext< T >:
[legend]
Collaboration diagram for GeometryContext< T >:
[legend]

Public Member Functions

 GeometryContext (int geometry_state_index)
 Constructs the context with the given index for the geometry state. More...
 
GeometryState< T > & get_mutable_geometry_state ()
 Returns a mutable reference of the underlying geometry state. More...
 
const GeometryState< T > & get_geometry_state () const
 Returns a const reference of the underlying geometry state. More...
 
Does not allow copy, move, or assignment
 GeometryContext (const GeometryContext &)=delete
 
GeometryContextoperator= (const GeometryContext &)=delete
 
 GeometryContext (GeometryContext &&)=delete
 
GeometryContextoperator= (GeometryContext &&)=delete
 
- Public Member Functions inherited from LeafContext< T >
 LeafContext ()
 
 ~LeafContext () override
 
const State< T > & get_state () const final
 
State< T > & get_mutable_state () final
 
void set_parameters (std::unique_ptr< Parameters< T >> params)
 Sets the parameters to params, deleting whatever was there before. More...
 
const Parameters< T > & get_parameters () const final
 Returns the entire Parameters object. More...
 
Parameters< T > & get_mutable_parameters () final
 Returns the entire Parameters object. More...
 
 LeafContext (LeafContext &&)=delete
 
LeafContextoperator= (const LeafContext &)=delete
 
LeafContextoperator= (LeafContext &&)=delete
 
- Public Member Functions inherited from Context< T >
std::unique_ptr< Context< T > > Clone () const
 Returns a deep copy of this Context. More...
 
 ~Context () override=default
 
const T & get_time () const
 Returns the current time in seconds. More...
 
virtual void set_time (const T &time_sec)
 Set the current time in seconds. More...
 
bool is_stateless () const
 Returns true if the Context has no state. More...
 
bool has_only_continuous_state () const
 Returns true if the Context has continuous state, but no discrete or abstract state. More...
 
bool has_only_discrete_state () const
 Returns true if the Context has discrete state, but no continuous or abstract state. More...
 
int get_num_total_states () const
 Returns the total dimension of all of the basic vector states (as if they were muxed). More...
 
void set_continuous_state (std::unique_ptr< ContinuousState< T >> xc)
 Sets the continuous state to xc, deleting whatever was there before. More...
 
ContinuousState< T > & get_mutable_continuous_state ()
 Returns a mutable reference to the continuous component of the state, which may be of size zero. More...
 
VectorBase< T > & get_mutable_continuous_state_vector ()
 Returns a mutable reference to the continuous state vector, devoid of second-order structure. More...
 
const ContinuousState< T > & get_continuous_state () const
 Returns a const reference to the continuous component of the state, which may be of size zero. More...
 
const VectorBase< T > & get_continuous_state_vector () const
 Returns a reference to the continuous state vector, devoid of second-order structure. More...
 
int get_num_discrete_state_groups () const
 Returns the number of vectors (groups) in the discrete state. More...
 
const DiscreteValues< T > & get_discrete_state () const
 Returns a reference to the entire discrete state, which may consist of multiple discrete state vectors (groups). More...
 
const BasicVector< T > & get_discrete_state_vector () const
 Returns a reference to the only discrete state vector. More...
 
DiscreteValues< T > & get_mutable_discrete_state ()
 Returns a mutable reference to the discrete component of the state, which may be of size zero. More...
 
BasicVector< T > & get_mutable_discrete_state_vector ()
 Returns a mutable reference to the only discrete state vector. More...
 
BasicVector< T > & get_mutable_discrete_state (int index)
 Returns a mutable reference to group (vector) index of the discrete state. More...
 
void set_discrete_state (std::unique_ptr< DiscreteValues< T >> xd)
 Sets the discrete state to xd, deleting whatever was there before. More...
 
const BasicVector< T > & get_discrete_state (int index) const
 Returns a const reference to group (vector) index of the discrete state. More...
 
int get_num_abstract_states () const
 Returns the number of elements in the abstract state. More...
 
const AbstractValuesget_abstract_state () const
 Returns a const reference to the abstract component of the state, which may be of size zero. More...
 
AbstractValuesget_mutable_abstract_state ()
 Returns a mutable reference to the abstract component of the state, which may be of size zero. More...
 
template<typename U >
U & get_mutable_abstract_state (int index)
 Returns a mutable reference to element index of the abstract state. More...
 
void set_abstract_state (std::unique_ptr< AbstractValues > xa)
 Sets the abstract state to xa, deleting whatever was there before. More...
 
template<typename U >
const U & get_abstract_state (int index) const
 Returns a const reference to the abstract component of the state at index. More...
 
FixedInputPortValueFixInputPort (int index, std::unique_ptr< BasicVector< T >> vec)
 Connects the input port at index to a FixedInputPortValue with the given vector vec. More...
 
FixedInputPortValueFixInputPort (int index, const Eigen::Ref< const VectorX< T >> &data)
 Same as above method but starts with an Eigen vector whose contents are used to initialize a BasicVector in the FixedInputPortValue. More...
 
int num_numeric_parameters () const
 Returns the number of vector-valued parameters. More...
 
const BasicVector< T > & get_numeric_parameter (int index) const
 Returns a const reference to the vector-valued parameter at index. More...
 
BasicVector< T > & get_mutable_numeric_parameter (int index)
 Returns a mutable reference to element index of the vector-valued parameters. More...
 
int num_abstract_parameters () const
 Returns the number of abstract-valued parameters. More...
 
const AbstractValueget_abstract_parameter (int index) const
 Returns a const reference to the abstract-valued parameter at index. More...
 
AbstractValueget_mutable_abstract_parameter (int index)
 Returns a mutable reference to element index of the abstract-valued parameters. More...
 
virtual void set_accuracy (const optional< double > &accuracy)
 Records the user's requested accuracy. More...
 
const optional< double > & get_accuracy () const
 Returns the accuracy setting (if any). More...
 
std::unique_ptr< State< T > > CloneState () const
 Returns a deep copy of this Context's State. More...
 
void SetTimeStateAndParametersFrom (const Context< double > &source)
 Initializes this context's time, state, and parameters from the real values in source, regardless of this context's scalar type. More...
 
 Context (Context &&)=delete
 
Contextoperator= (const Context &)=delete
 
Contextoperator= (Context &&)=delete
 
- Public Member Functions inherited from ContextBase
std::unique_ptr< ContextBaseClone () const
 Creates an identical copy of the concrete context object. More...
 
 ~ContextBase () override
 
void DisableCaching () const
 (Debugging) Disables caching recursively for this context and all its subcontexts. More...
 
void EnableCaching () const
 (Debugging) Re-enables caching recursively for this context and all its subcontexts. More...
 
void SetAllCacheEntriesOutOfDate () const
 (Debugging) Marks all cache entries out of date, recursively for this context and all its subcontexts. More...
 
const std::string & GetSystemName () const final
 Returns the local name of the subsystem for which this is the Context. More...
 
std::string GetSystemPathname () const final
 Returns the full pathname of the subsystem for which this is the Context. More...
 
const Cacheget_cache () const
 Returns a const reference to this subcontext's cache. More...
 
Cacheget_mutable_cache () const
 (Advanced) Returns a mutable reference to this subcontext's cache. More...
 
const DependencyTrackerget_tracker (DependencyTicket ticket) const
 Returns a const reference to a DependencyTracker in this subcontext. More...
 
DependencyTrackerget_mutable_tracker (DependencyTicket ticket)
 Returns a mutable reference to a DependencyTracker in this subcontext. More...
 
const DependencyGraphget_dependency_graph () const
 Returns a const reference to the collection of value trackers within this subcontext. More...
 
DependencyGraphget_mutable_dependency_graph ()
 Returns a mutable reference to the dependency graph. More...
 
int get_num_input_ports () const
 Returns the number of input ports in this context. More...
 
FixedInputPortValueFixInputPort (int index, std::unique_ptr< AbstractValue > value)
 Connects the input port at index to a FixedInputPortValue with the given abstract value. More...
 
const FixedInputPortValueMaybeGetFixedInputPortValue (int index) const
 For input port index, returns a const FixedInputPortValue if the port is fixed, otherwise nullptr. More...
 
FixedInputPortValueMaybeGetMutableFixedInputPortValue (int index)
 For input port index, returns a mutable FixedInputPortValue if the port is fixed, otherwise nullptr. More...
 
 ContextBase (ContextBase &&)=delete
 
ContextBaseoperator= (const ContextBase &)=delete
 
ContextBaseoperator= (ContextBase &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from LeafContext< T >
 LeafContext (const LeafContext &source)
 Protected copy constructor takes care of the local data members and all base class members, but doesn't update base class pointers so is not a complete copy. More...
 
std::unique_ptr< ContextBaseDoCloneWithoutPointers () const override
 Derived classes should reimplement and replace this; don't recursively invoke it. More...
 
std::unique_ptr< State< T > > DoCloneState () const override
 Override to return the appropriate concrete State class to be returned by CloneState(). More...
 
- Protected Member Functions inherited from Context< T >
 Context ()=default
 
 Context (const Context< T > &)=default
 Copy constructor takes care of base class and Context<T> data members. More...
 
const StepInfo< T > & get_step_info () const
 Returns a const reference to current time and step information. More...
 
- Protected Member Functions inherited from ContextBase
 ContextBase ()
 Default constructor creates an empty ContextBase but initializes all the built-in dependency trackers that are the same in every System (like time, q, all states, all inputs, etc.). More...
 
 ContextBase (const ContextBase &)=default
 Copy constructor takes care of base class data members, but does not fix up base class pointers. More...
 
- Static Protected Member Functions inherited from Context< T >
static std::unique_ptr< Context< T > > CloneWithoutPointers (const Context< T > &source)
 Clones a context but without any of its internal pointers. More...
 
- Static Protected Member Functions inherited from ContextBase
static std::unique_ptr< ContextBaseCloneWithoutPointers (const ContextBase &source)
 Clones a context but without copying any of its internal pointers; the clone's pointers are set to null. More...
 
static void set_parent (ContextBase *child, const ContextBase *parent)
 Declares that parent is the context of the enclosing Diagram. More...
 

Detailed Description

template<typename T>
class drake::geometry::GeometryContext< T >

The custom leaf context type for SceneGraph.

Template Parameters
TThe scalar type. Must be a valid Eigen scalar.

Instantiated templates for the following kinds of T's are provided:

  • double
  • AutoDiffXd

They are already available to link against in the containing library. No other values for T are currently supported.

Constructor & Destructor Documentation

GeometryContext ( const GeometryContext< T > &  )
delete
GeometryContext ( GeometryContext< T > &&  )
delete
GeometryContext ( int  geometry_state_index)
explicit

Constructs the context with the given index for the geometry state.

Member Function Documentation

const GeometryState< T > & get_geometry_state ( ) const

Returns a const reference of the underlying geometry state.

Here is the call graph for this function:

Here is the caller graph for this function:

GeometryState< T > & get_mutable_geometry_state ( )

Returns a mutable reference of the underlying geometry state.

Here is the call graph for this function:

GeometryContext& operator= ( const GeometryContext< T > &  )
delete
GeometryContext& operator= ( GeometryContext< T > &&  )
delete

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