src/classify/picofeat.cpp
void ConvertSegmentToPicoFeat(FPOINT *Start, FPOINT *End, FEATURE_SET FeatureSet) {
  float Angle;
  float Length;
  int NumFeatures;
  FPOINT Center;
  FPOINT Delta;
  int i;

  Angle = NormalizedAngleFrom(Start, End, 1.0);
  Length = DistanceBetween(*Start, *End);
  NumFeatures = static_cast<int>(floor(Length / classify_pico_feature_length + 0.5));
  if (NumFeatures < 1) {
    NumFeatures = 1;
  }

  /* compute vector for one pico feature */
  Delta.x = XDelta(*Start, *End) / NumFeatures;
  Delta.y = YDelta(*Start, *End) / NumFeatures;

  /* compute position of first pico feature */
  Center.x = Start->x + Delta.x / 2.0;
  Center.y = Start->y + Delta.y / 2.0;

  /* compute each pico feature in segment and add to feature set */
  for (i = 0; i < NumFeatures; i++) {
    auto Feature = new FEATURE_STRUCT(&PicoFeatDesc);
    Feature->Params[PicoFeatDir] = Angle;
    Feature->Params[PicoFeatX] = Center.x;
    Feature->Params[PicoFeatY] = Center.y;
    AddFeature(FeatureSet, Feature);

    Center.x += Delta.x;
    Center.y += Delta.y;
  }
}
/*---------------------------------------------------------------------------*/
/**
 * This routine converts an entire segment of an outline
 * into a set of pico features which are added to
 * FeatureSet.  The length of the segment is rounded to the
 * nearest whole number of pico-features.  The pico-features
 * are spaced evenly over the entire segment.
 * Results are placed in FeatureSet.
 * Globals:
 * - classify_pico_feature_length length of a single pico-feature
 * @param Start starting point of pico-feature
 * @param End ending point of pico-feature
 * @param FeatureSet set to add pico-feature to
 */
This routine converts an entire segment of an outline
into a set of pico features which are added to
FeatureSet.  The length of the segment is rounded to the
nearest whole number of pico-features.  The pico-features
are spaced evenly over the entire segment.
Results are placed in FeatureSet.
This routine converts an entire segment of an outline into a set of pico features which are added to FeatureSet . The length of the segment is rounded to the nearest whole number of pico - features . The pico - features are spaced evenly over the entire segment . Results are placed in FeatureSet .
void ConvertSegmentToPicoFeat(FPOINT *Start, FPOINT *End, FEATURE_SET FeatureSet) {
  float Angle;
  float Length;
  int NumFeatures;
  FPOINT Center;
  FPOINT Delta;
  int i;
  Angle = NormalizedAngleFrom(Start, End, 1.0);
  Length = DistanceBetween(*Start, *End);
  NumFeatures = static_cast<int>(floor(Length / classify_pico_feature_length + 0.5));
  if (NumFeatures < 1) {
    NumFeatures = 1;
  }
  Delta.x = XDelta(*Start, *End) / NumFeatures;
  Delta.y = YDelta(*Start, *End) / NumFeatures;
  Center.x = Start->x + Delta.x / 2.0;
  Center.y = Start->y + Delta.y / 2.0;
  for (i = 0; i < NumFeatures; i++) {
    auto Feature = new FEATURE_STRUCT(&PicoFeatDesc);
    Feature->Params[PicoFeatDir] = Angle;
    Feature->Params[PicoFeatX] = Center.x;
    Feature->Params[PicoFeatY] = Center.y;
    AddFeature(FeatureSet, Feature);
    Center.x += Delta.x;
    Center.y += Delta.y;
  }
}
void ConvertSegmentToPicoFeat ( FPOINT * Start , FPOINT * End , FEATURE_SET FeatureSet ) { float Angle ; float Length ; int NumFeatures ; FPOINT Center ; FPOINT Delta ; int i ; Angle = NormalizedAngleFrom ( Start , End , 1.0 ) ; Length = DistanceBetween ( * Start , * End ) ; NumFeatures = static_cast < int > ( floor ( Length / classify_pico_feature_length + 0.5 ) ) ; if ( NumFeatures < 1 ) { NumFeatures = 1 ; } Delta . x = XDelta ( * Start , * End ) / NumFeatures ; Delta . y = YDelta ( * Start , * End ) / NumFeatures ; Center . x = Start -> x + Delta . x / 2.0 ; Center . y = Start -> y + Delta . y / 2.0 ; for ( i = 0 ; i < NumFeatures ; i ++ ) { auto Feature = new FEATURE_STRUCT ( & PicoFeatDesc ) ; Feature -> Params [ PicoFeatDir ] = Angle ; Feature -> Params [ PicoFeatX ] = Center . x ; Feature -> Params [ PicoFeatY ] = Center . y ; AddFeature ( FeatureSet , Feature ) ; Center . x += Delta . x ; Center . y += Delta . y ; } }
This routine converts an entire segment of an outline
 into a set of pico features which are added to
 FeatureSet.
This routine converts an entire segment of an outline into a set of pico features which are added to FeatureSet .
/* compute vector for one pico feature */ /* compute position of first pico feature */ /* compute each pico feature in segment and add to feature set */