COPASI API  4.16.103
Public Member Functions | List of all members
compareGraphicalObjectsBySize Class Reference

#include <utility_classes.h>

Public Member Functions

bool operator() (const CLGraphicalObject *pObject1, const CLGraphicalObject *pObject2) const
 

Detailed Description

Definition at line 87 of file utility_classes.h.

Member Function Documentation

bool compareGraphicalObjectsBySize::operator() ( const CLGraphicalObject pObject1,
const CLGraphicalObject pObject2 
) const

Definition at line 109 of file utility_classes.cpp.

References CLGraphicalObject::getBoundingBox(), CLGlyphWithCurve::getCurve(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLCurve::getNumCurveSegments(), and CLDimensions::getWidth().

110 {
111  const CLReactionGlyph* pRG1 = dynamic_cast<const CLReactionGlyph*>(pObject1);
112  const CLReactionGlyph* pRG2 = dynamic_cast<const CLReactionGlyph*>(pObject2);
113  const CLMetabReferenceGlyph* pSRG1 = dynamic_cast<const CLMetabReferenceGlyph*>(pObject1);
114  const CLMetabReferenceGlyph* pSRG2 = dynamic_cast<const CLMetabReferenceGlyph*>(pObject2);
115  bool result = false;
116 
117  if (!(((pRG1 && pRG1->getCurve().getNumCurveSegments() != 0) || (pSRG1 && pSRG1->getCurve().getNumCurveSegments() != 0)) && ((pRG2 && pRG2->getCurve().getNumCurveSegments() != 0) || (pSRG2 && pSRG2->getCurve().getNumCurveSegments() != 0))))
118  {
119  result = ((pObject1->getBoundingBox().getDimensions().getWidth() * pObject1->getBoundingBox().getDimensions().getHeight()) < (pObject2->getBoundingBox().getDimensions().getWidth() * pObject2->getBoundingBox().getDimensions().getHeight()));
120  }
121 
122  return result;
123 }
const C_FLOAT64 & getWidth() const
Definition: CLBase.h:211
const CLBoundingBox & getBoundingBox() const
const CLDimensions & getDimensions() const
Definition: CLBase.h:266
const C_FLOAT64 & getHeight() const
Definition: CLBase.h:212
const CLCurve & getCurve() const
size_t getNumCurveSegments() const
Definition: CLCurve.h:168

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