All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
QGpCompatibility::CompatModalCurves Class Reference

#include <CompatModalCurves.h>

Inheritance diagram for QGpCompatibility::CompatModalCurves:
QGpCoreTools::XMLClass

List of all members.

Public Member Functions

void addInvalid ()
void insertInvalidAt (int i)
void insertModes (int atMode, int nNewModes)
const double & invalidValue () const
QVector< double > * meanVector (int im) const
CompatVDataPointVectormode (int imode)
const CompatVDataPointVectormode (int imode) const
int nModes () const
int nOmegas () const
void operator= (const CompatModalCurves &o)
void resetValues ()
void resetValues (int im)
void setInvalidValue (double val)
virtual void setNModes (int nm)
void setNOmegas (int nf)
QVector< double > * stddevVector (int im) const
int validValues (int im) const
QVector< double > * weightVector (int im) const
virtual ~CompatModalCurves ()

Protected Member Functions

CompatVDataPointVector invalidMode ()
virtual XMLMember xml_member (XML_MEMBER_ARGS)
virtual const QString & xml_tagName () const
virtual void xml_writeChildren (XML_WRITECHILDREN_ARGS) const

Protected Attributes

double _invalidValue

Static Protected Attributes

static const QString xmlModalCurvesTag = "ModalCurves"

Constructor & Destructor Documentation

{}

Member Function Documentation

References _invalidValue, mode(), nModes(), and TRACE.

{
  TRACE;
  int nm=nModes();
  CompatVDataPoint invalidPoint(_invalidValue, 0.0, 0.0);
  for(int im=0;im<nm;im++) {
    mode(im).append(invalidPoint);
  }
}

References _invalidValue, mode(), nModes(), and TRACE.

{
  TRACE;
  int nm=nModes();
  CompatVDataPoint invalidPoint(_invalidValue, 0.0, 0.0);
  for(int im=0;im<nm;im++) {
    mode(im).insert(i,invalidPoint);
  }
}
void QGpCompatibility::CompatModalCurves::insertModes ( int  atMode,
int  nNewModes 
)

References invalidMode(), and TRACE.

Referenced by QGpCompatibility::CompatModalRefinedCurves::addRayleighModes().

{
  TRACE;
  CompatVDataPointVector m=invalidMode();
  insert(atMode, nNewModes, m);
}

References _invalidValue, nOmegas(), and TRACE.

Referenced by insertModes(), and setNModes().

{
  TRACE;
  CompatVDataPointVector m;
  CompatVDataPoint invalidPoint(_invalidValue, 0.0, 0.0);
  int nf=nOmegas();
  m.resize(nf);
  for(int i=0;i<nf;i++) m[i]=invalidPoint;
  return m;
}
const double& QGpCompatibility::CompatModalCurves::invalidValue ( ) const [inline]

References nModes().

{
  ASSERT(im<nModes());
  return (*this)[im].meanVector();
}
{return operator[] (imode);}

Referenced by invalidMode(), QGpCompatibility::operator<<(), QGpCompatibility::operator>>(), resetValues(), and validValues().

{return (nModes() > 0) ? ( *this) [ 0 ].count() : 0;}
void QGpCompatibility::CompatModalCurves::operator= ( const CompatModalCurves o)

References _invalidValue, and TRACE.

References nModes(), and TRACE.

{
  TRACE;
  int nm=nModes();
  for(int im=0;im<nm;im++) resetValues(im);
}

References _invalidValue, mode(), nOmegas(), and TRACE.

{
  TRACE;
  int nf=nOmegas();
  CompatVDataPointVector& point=mode(im);
  for(int i=0;i<nf;i++) point[i].setValue(_invalidValue);
}

References invalidMode(), nModes(), and TRACE.

{
  TRACE;
  if(nm>nModes()) {
   CompatVDataPointVector m=invalidMode();
   while(nModes()<nm) append(m);
  } else if(nm<nModes()) {
    resize(nm);
  }
}

References mode(), nModes(), and TRACE.

Referenced by QGpCompatibility::CompatModalRefinedCurves::setNOmegas().

{
  TRACE;
  int nm=nModes();
  for(int i=0;i<nm;i++) mode(i).resize(nf);
}

References nModes().

{
  ASSERT(im<nModes());
  return (*this)[im].stddevVector();
}

References _invalidValue, mode(), nOmegas(), and TRACE.

{
  TRACE;
  int n=0;
  const CompatVDataPointVector& point=mode(im);
  int nf=nOmegas();
  for(int i=0;i<nf;i++) {
    if(point[i].value()!=_invalidValue) n++;
  }
  return n;
}

References nModes().

{
  ASSERT(im<nModes());
  return (*this)[im].weightVector();
}

Re-implement this function to offer XML restore (children and properties) support to your class.

From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:

  • An integer: id number of a property
  • A XMLClass * : a child of this object identified by tag
  • Default constructor: error, unknow child or property

Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):

    static const QString tmp("childrenName");
    XMLRestoreAttributeIterator it=map.find(tmp);
    if(it!=map.end()) {
      // found attribute "childrenName"
    }

If the map of attributes is not used:

    Q_UNUSED(attributes);
    if(tag=="x1") return XMLMember(0);
    else if(tag=="y1") return XMLMember(1);
    else if(tag=="x2") return XMLMember(2);
    else if(tag=="y2") return XMLMember(3);
    else return XMLMember(XMLMember::Unknown);

Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.

    if(tag=="anInteger") return XMLMember(0);
    else if(tag=="aString") return XMLMember(1);
    else if(tag=="aDouble") return XMLMember(2);
    return AbstractLine::xml_member(tag, attributes, context)+3;

For the arguments of this function use Macro XML_MEMBER_ARGS.

Reimplemented from QGpCoreTools::XMLClass.

References TRACE.

{
  TRACE;
  Q_UNUSED(attributes);
  Q_UNUSED(context);
  if(tag=="DataPointVector") {
    append(CompatVDataPointVector());
    return XMLMember(&last());
  } else return XMLMember(XMLMember::Unknown);
}
virtual const QString& QGpCompatibility::CompatModalCurves::xml_tagName ( ) const [inline, protected, virtual]

Reimplemented from QGpCoreTools::XMLClass.

References QGpCoreTools::XMLSaveAttributes::add(), nModes(), and TRACE.

{
  TRACE;
  int nm=nModes();
  static const QString key("mode");
  XMLSaveAttributes att;
  QString& value=att.add(key);
  for(int i=0;i<nm;i++) {
    value=QString::number(i);
    (*this)[i].xml_save(s, context, att);
  }
}

Member Data Documentation

const QString QGpCompatibility::CompatModalCurves::xmlModalCurvesTag = "ModalCurves" [static, protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines