COPASI API
4.40.278
|
#include <CSlider.h>
Public Types | |
enum | Scale { linear = 0 , logarithmic , undefinedScale } |
enum | Type { Float = 0 , UnsignedFloat , Integer , UnsignedInteger , Undefined } |
Public Types inherited from CDataContainer | |
typedef CDataObjectMap | objectMap |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Public Member Functions | |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
bool | compile (const CObjectInterface::ContainerList &listOfContainer) |
Scale | convertScaleNameToScale (const char *scaleName) |
const char * | convertScaleToScaleName (Scale scale) const |
CSlider (const CSlider &src, const CDataContainer *pParent) | |
CSlider (const std::string &name="Slider", const CDataContainer *pParent=NO_PARENT) | |
const std::string & | getAssociatedEntityKey () const |
const std::string & | getKey () const |
const C_FLOAT64 & | getMaxValue () const |
const C_FLOAT64 & | getMinValue () const |
const C_FLOAT64 & | getOriginalValue () const |
Scale | getScaling () const |
const CDataObject * | getSliderObject () const |
const std::string & | getSliderObjectCN () const |
CSlider::Type | getSliderType () const |
const C_FLOAT64 & | getSliderValue () const |
bool | getSynced () const |
unsigned C_INT32 | getTickFactor () const |
unsigned C_INT32 | getTickNumber () const |
bool | isValid () const |
void | resetRange () |
void | resetValue () |
bool | setAssociatedEntityKey (const std::string &associatedEntityKey) |
bool | setMaxValue (const C_FLOAT64 maxValue) |
bool | setMinValue (const C_FLOAT64 minValue) |
bool | setOriginalValue (const C_FLOAT64 value) |
bool | setScaling (Scale scaling) |
bool | setSliderObject (const CCommonName &objectCN) |
bool | setSliderObject (const CDataObject *pObject) |
bool | setSliderType (const CSlider::Type type) |
bool | setSliderValue (const C_FLOAT64 value, const bool &writeToObject=true) |
void | setSynced (bool synced) |
bool | setTickFactor (const unsigned C_INT32 tickFactor) |
bool | setTickNumber (const unsigned C_INT32 tickNumber) |
void | sync () |
virtual CData | toData () const |
void | writeToObject () |
~CSlider () | |
Public Member Functions inherited from CDataContainer | |
virtual bool | add (CDataObject *pObject, const bool &adopt=true) |
virtual bool | appendDeletedDependentData (CUndoData &undoData) const |
CDataContainer (const CDataContainer &src, const CDataContainer *pParent) | |
CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual std::string | getChildObjectUnits (const CDataObject *pObject) const |
void | getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const |
virtual size_t | getIndex (const CDataObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
virtual objectMap & | getObjects () |
virtual const objectMap & | getObjects () const |
virtual const std::string | getUnits () const override |
virtual const CDataObject * | getValueObject () const override |
virtual CUndoObjectInterface * | insert (const CData &data) override |
void | objectRenamed (CDataObject *pObject, const std::string &oldName) |
virtual bool | remove (CDataObject *pObject) |
virtual | ~CDataContainer () |
Public Member Functions inherited from CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
virtual void | calculateValue () override |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () const override |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName () const override |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const CValidity & | getValidity () const override |
virtual void * | getValuePointer () const override |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
virtual void | print (std::ostream *ostream) const override |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CDataContainer *pParent) |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CUndoObjectInterface () |
Static Public Member Functions | |
static CSlider * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataContainer | |
static CDataContainer * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
Static Public Attributes | |
static const char * | ScaleName [] |
static const char * | TypeName [] |
Static Public Attributes inherited from CDataContainer | |
static const CObjectInterface::ContainerList | EmptyList |
Private Attributes | |
std::string | mAssociatedEntityKey |
CRegisteredCommonName | mCN |
CCore::CUpdateSequence | mInitialRefreshes |
std::string | mKey |
C_FLOAT64 | mMaxValue |
C_FLOAT64 | mMinValue |
C_FLOAT64 | mOriginalValue |
CDataObject * | mpSliderObject |
Scale | mScaling |
Type | mSliderType |
bool | mSync |
unsigned C_INT32 | mTickFactor |
unsigned C_INT32 | mTickNumber |
C_FLOAT64 | mValue |
Additional Inherited Members | |
Protected Member Functions inherited from CDataContainer | |
template<class CType > | |
CDataMatrixReference< CType > * | addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataObjectReference< CType > * | addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataVectorReference< CType > * | addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
CDataContainer (const CDataContainer &src) | |
void | initObjects () |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
Protected Attributes inherited from CDataContainer | |
objectMap | mObjects |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
enum CSlider::Scale |
enum CSlider::Type |
CSlider::CSlider | ( | const std::string & | name = "Slider" , |
const CDataContainer * | pParent = NO_PARENT |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CDataContainer * pParent (default: NULL) |
Referenced by fromData().
CSlider::CSlider | ( | const CSlider & | src, |
const CDataContainer * | pParent | ||
) |
Copy constructor
const | CSlider & src |
const | CDataContainer * pParent (default: NULL) |
CSlider::~CSlider | ( | ) |
Destructor.
References CRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().
|
virtual |
Apply the provided data to the object
const | CData & data |
Reimplemented from CDataContainer.
References fatalError.
bool CSlider::compile | ( | const CObjectInterface::ContainerList & | listOfContainer | ) |
Compile, i.e., find the objects pointed to by the CN.
const | CObjectInterface::ContainerList & listOfContainer (default: CDataContainer::EmptyList) |
References CObjectInterface::DataObject(), CDataObject::getObjectDataModel(), CObjectInterface::GetObjectFromCN(), mCN, mpSliderObject, mSync, setSliderObject(), and sync().
CSlider::Scale CSlider::convertScaleNameToScale | ( | const char * | scaleName | ) |
Converts the scaling name to the corresponding enum.
References linear, logarithmic, and undefinedScale.
Referenced by SliderHandler::processStart().
const char * CSlider::convertScaleToScaleName | ( | Scale | scale | ) | const |
Converts the scaling name to the corresponding enum.
References ScaleName, and undefinedScale.
Referenced by CCopasiXML::saveGUI().
|
static |
Static method to create a CDataObject based on the provided data
const | CData & data |
References CSlider(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, and CDataValue::toString().
const std::string & CSlider::getAssociatedEntityKey | ( | ) | const |
Retrieve the key of the associated entity.
References mAssociatedEntityKey.
Referenced by CCopasiXML::saveGUI().
|
virtual |
Retrieve the key
Reimplemented from CDataObject.
References mKey.
Referenced by CCopasiXML::saveGUI().
const C_FLOAT64 & CSlider::getMaxValue | ( | ) | const |
Retrieve the slider maximum value.
References mMaxValue.
Referenced by CCopasiXML::saveGUI().
const C_FLOAT64 & CSlider::getMinValue | ( | ) | const |
Retrieve the slider minimum value.
References mMinValue.
Referenced by CCopasiXML::saveGUI().
const C_FLOAT64 & CSlider::getOriginalValue | ( | ) | const |
CSlider::Scale CSlider::getScaling | ( | ) | const |
Retrieve the scaling of the slider.
References mScaling.
Referenced by CCopasiXML::saveGUI().
const CDataObject * CSlider::getSliderObject | ( | ) | const |
const std::string & CSlider::getSliderObjectCN | ( | ) | const |
Retrieve the slider object CN.
References mCN.
Referenced by CCopasiXML::saveGUI().
CSlider::Type CSlider::getSliderType | ( | ) | const |
Retrieve the slider type.
References mSliderType.
Referenced by CCopasiXML::saveGUI().
const C_FLOAT64 & CSlider::getSliderValue | ( | ) | const |
Retrieve the slider Value.
References mValue.
Referenced by resetRange(), CCopasiXML::saveGUI(), setMaxValue(), setMinValue(), and setSliderObject().
bool CSlider::getSynced | ( | ) | const |
Returns whether the value is to be kept in sync the the objects value.
References mSync.
unsigned C_INT32 CSlider::getTickFactor | ( | ) | const |
Retrieve the tick factor.
References mTickFactor.
Referenced by CCopasiXML::saveGUI().
unsigned C_INT32 CSlider::getTickNumber | ( | ) | const |
Retrieve the tick number.
References mTickNumber.
Referenced by CCopasiXML::saveGUI().
bool CSlider::isValid | ( | ) | const |
Checks whether the object the slider points to actually exists. Returns true if it does.
References CObjectInterface::DataObject(), CDataModel::getModel(), CDataObject::getObjectDataModel(), CDataObject::getObjectFromCN(), and mpSliderObject.
void CSlider::resetRange | ( | ) |
Reset the minimum and maximum value to defaults. For the minimum this is half the current value. For the maximum this is twice the current value.
References C_FLOAT64, getSliderValue(), mMaxValue, mMinValue, mSliderType, and Undefined.
void CSlider::resetValue | ( | ) |
Sets the value of the slider back to it's original value.
References mOriginalValue, and setSliderValue().
bool CSlider::setAssociatedEntityKey | ( | const std::string & | associatedEntityKey | ) |
Set the key of the associated entity
const | std::string & associatedEntityKey |
References CRootContainer::getKeyFactory(), and mAssociatedEntityKey.
Referenced by SliderHandler::processStart().
bool CSlider::setMaxValue | ( | const C_FLOAT64 | maxValue | ) |
Set the slider maximum value.
const | C_FLOAT64 maxValue |
References getSliderValue(), mMaxValue, mMinValue, mpSliderObject, mSliderType, mValue, Undefined, and writeToObject().
Referenced by SliderHandler::processStart().
bool CSlider::setMinValue | ( | const C_FLOAT64 | minValue | ) |
Set the slider minimum value.
const | C_FLOAT64 minValue |
References getSliderValue(), mMaxValue, mMinValue, mpSliderObject, mSliderType, mValue, Undefined, and writeToObject().
Referenced by SliderHandler::processStart().
bool CSlider::setOriginalValue | ( | const C_FLOAT64 | value | ) |
Set the sliders original value.
const | C_FLOAT64 Value |
const | bool & writeToObject (Default: true) |
References mMaxValue, mMinValue, mOriginalValue, mSliderType, and Undefined.
bool CSlider::setScaling | ( | CSlider::Scale | scaling | ) |
bool CSlider::setSliderObject | ( | const CCommonName & | objectCN | ) |
bool CSlider::setSliderObject | ( | const CDataObject * | pObject | ) |
Set the slider object.
const | CDataObject * pObject |
References CModel::buildInitialRefreshSequence(), C_FLOAT64, CMathUpdateSequence::clear(), Float, CDataObject::getCN(), CDataModel::getModel(), CDataObject::getObjectDataModel(), getSliderValue(), CDataObject::hasFlag(), Integer, linear, mCN, mInitialRefreshes, mMaxValue, mMinValue, mOriginalValue, mpSliderObject, mScaling, mSync, setSliderType(), sync(), Undefined, CDataObject::ValueDbl, and CDataObject::ValueInt.
Referenced by compile(), and SliderHandler::processStart().
bool CSlider::setSliderType | ( | const CSlider::Type | type | ) |
Set the slider type.
const | CSlider::Type type |
References mSliderType.
Referenced by SliderHandler::processStart(), and setSliderObject().
bool CSlider::setSliderValue | ( | const C_FLOAT64 | value, |
const bool & | writeToObject = true |
||
) |
Set the slider value.
const | C_FLOAT64 Value |
const | bool & writeToObject (Default: true) |
References mMaxValue, mMinValue, mSliderType, mSync, mValue, Undefined, and writeToObject().
Referenced by SliderHandler::processStart(), and resetValue().
void CSlider::setSynced | ( | bool | synced | ) |
Sets whether the value is to be kept in sync the the objects value.
References mSync.
bool CSlider::setTickFactor | ( | const unsigned C_INT32 | tickFactor | ) |
Set the tick factor.
const | unsigned C_INT32 & tickFactor |
References mTickFactor.
Referenced by SliderHandler::processStart().
bool CSlider::setTickNumber | ( | const unsigned C_INT32 | tickNumber | ) |
Set the tick number.
const | unsigned C_INT32 & tickNumber |
References mTickNumber.
Referenced by SliderHandler::processStart().
void CSlider::sync | ( | ) |
Set the CSliders value to the value of the underlying object.
References C_FLOAT64, C_INT32, Float, CDataObject::getValuePointer(), Integer, mpSliderObject, mSliderType, mValue, UnsignedFloat, and UnsignedInteger.
Referenced by compile(), and setSliderObject().
|
virtual |
Retrieve the data describing the object
Reimplemented from CDataContainer.
References fatalError.
void CSlider::writeToObject | ( | ) |
Set the objects value to the value stored in CSlider.
References C_FLOAT64, C_INT32, CDataObject::Container, CModel::getMathContainer(), CDataModel::getModel(), CDataObject::getObjectDataModel(), CDataObject::getValuePointer(), CDataObject::hasFlag(), mInitialRefreshes, mpSliderObject, mValue, CDataObject::ValueBool, CDataObject::ValueDbl, and CDataObject::ValueInt.
Referenced by setMaxValue(), setMinValue(), and setSliderValue().
|
private |
The key of the associated entity of the slider's object.
Referenced by getAssociatedEntityKey(), and setAssociatedEntityKey().
|
private |
The CN of the object that the slider modifies.
Referenced by compile(), getSliderObjectCN(), and setSliderObject().
|
private |
The sequnece of methods to update initial values depending on this sliders object.
Referenced by setSliderObject(), and writeToObject().
|
private |
The key of the slider.
Referenced by getKey(), and ~CSlider().
|
private |
The maximum value of the slider
Referenced by getMaxValue(), resetRange(), setMaxValue(), setMinValue(), setOriginalValue(), setSliderObject(), and setSliderValue().
|
private |
The minimun value of the slider
Referenced by getMinValue(), resetRange(), setMaxValue(), setMinValue(), setOriginalValue(), setSliderObject(), and setSliderValue().
|
private |
The original value of the slider-
Referenced by getOriginalValue(), resetValue(), setOriginalValue(), and setSliderObject().
|
private |
The slider object pointing to the slider's object after compile.
Referenced by compile(), getSliderObject(), isValid(), setMaxValue(), setMinValue(), setSliderObject(), sync(), and writeToObject().
|
private |
The scaling of the slider.
Referenced by getScaling(), setScaling(), and setSliderObject().
|
private |
The value type of the slider's object.
Referenced by getSliderType(), resetRange(), setMaxValue(), setMinValue(), setOriginalValue(), setSliderType(), setSliderValue(), and sync().
|
private |
Wether the CSlider's value is always in sync with its object's value.
Referenced by compile(), getSynced(), setSliderObject(), setSliderValue(), and setSynced().
|
private |
The factor between minor and major ticks.
Referenced by getTickFactor(), and setTickFactor().
|
private |
The number of ticks the slider is divided into.
Referenced by getTickNumber(), and setTickNumber().
|
private |
The value of the slider-
Referenced by getSliderValue(), setMaxValue(), setMinValue(), setSliderValue(), sync(), and writeToObject().
|
static |
String representation of valid scalings
Referenced by convertScaleToScaleName().
|
static |
String representation of valid quantity units
Referenced by SliderHandler::processStart(), and CCopasiXML::saveGUI().