feature - OpenIndy/OpenIndy GitHub Wiki
There are four kinds of feature:
OpenIndy describes the "world" through features. A feature has all the necessary attributes to describe it. But a feature doesn't know how to get valid values for his attributes. To calculate values for the attributes of the feature, OpenIndy uses functions. Functions uses other features or observations to solve "his" feature.
For example:
A point feature (geometry) knows his attributes (x,y,z), but it doesn't know how to get them. You set a best fit function for the point. This functions uses any number of observations to solve the attributes of the point.
Common attributes of any feature:
class Feature : public Element
{
public:
virtual ~Feature();
QString name;
QString group;
bool isUpdated;
bool isSolved;
QList<Function*> functionList;
QList<FeatureWrapper*> usedFor; //features which need this feature to recalc
QList<FeatureWrapper*> previouslyNeeded; //features which are needed to recalc this feature
Configuration::eColor displayColor;
};
attribute | description |
---|---|
group | name of the group to which the feature belongs to |
isUpdated | true if the feature was successfully transformed into another coordinate system |
isSolved | true if a function solves the feature |
functionList | a list of all functions of the feature |
usedFor | a list of all feature that uses this feature |
previouslyNeeded | a list of all feature which are used by this feature |
displayColor | color of the feature |
All features are stored as featureWrapper in one list in the controller class. To avoid type conversions (downcast), the featureWrapper has a pointer for each feature type.
void FeatureWrapper::setPoint(Point *p){
if(p != NULL){
this->myFeature = p;
this->myGeometry = p;
this->myPoint = p;
this->typeOfFeature = Configuration::ePointFeature;
}
}
Point* FeatureWrapper::getPoint(){
return this->myPoint;
}