CEdgesReductorComp.h
Go to the documentation of this file.
1 #ifndef iedge_CEdgesReductorComp_included
2 #define iedge_CEdgesReductorComp_included
3 
4 
5 // ACF includes
6 #include "istd/TSmartPtr.h"
8 
9 // ACF-Solutions includes
10 #include "imeas/INumericValue.h"
12 
14 
15 
16 namespace iedge
17 {
18 
19 
21  public iproc::TSyncProcessorCompBase<IEdgeLinesProcessor>,
22  virtual public imeas::INumericConstraints
23 {
24 public:
26 
27  I_BEGIN_COMPONENT(CEdgesReductorComp);
28  I_REGISTER_INTERFACE(IEdgeLinesProcessor);
29  I_REGISTER_INTERFACE(imeas::INumericConstraints);
30  I_ASSIGN(m_defaultToleranceParamsCompPtr, "DefaultToleranceParams", "Default parameter for thresholds, if not taken from parameters", false, "DefaultToleranceParams");
31  I_ASSIGN(m_toleranceParamsIdAttrPtr, "ToleranceParamsId", "Parameter ID (imeas::INumericValue) for reduction tolerance", false, "ReductionTolerances");
32  I_ASSIGN(m_distanceUnitInfoCompPtr, "DistanceUnitInfo", "Unit information used for distance tolerance", false, "DistanceUnit");
33  I_END_COMPONENT;
34 
35  void GetReducedLine(
36  const CEdgeLine& edgeLine,
37  double positionTolerance,
38  double weightTolerance,
39  CEdgeLine& result) const;
40  void GetReducedLines(
41  const CEdgeLineContainer& edgeLines,
42  double positionTolerance,
43  double weightTolerance,
44  CEdgeLineContainer& result) const;
45 
46  // reimplemented (iedge::IEdgeLinesProcessor)
47  virtual bool DoLinesProcessing(
48  const iprm::IParamsSet* paramsPtr,
49  const CEdgeLineContainer& edgeLines,
50  CEdgeLineContainer& result) const;
51 
52  // reimplemented (iproc::IProcessor)
53  virtual int DoProcessing(
54  const iprm::IParamsSet* paramsPtr,
55  const istd::IPolymorphic* inputPtr,
56  istd::IChangeable* outputPtr,
57  ibase::IProgressManager* progressManagerPtr = NULL);
58 
59  // reimplemented (imeas::INumericConstraints)
60  virtual int GetNumericValuesCount() const;
61  virtual QString GetNumericValueName(int index) const;
62  virtual QString GetNumericValueDescription(int index) const;
63  virtual const imath::IUnitInfo& GetNumericValueUnitInfo(int index) const;
64 
65 protected:
66  typedef QVector<bool> NodesToRemove;
67 
72  int ReduceNodes(
73  const CEdgeLine& edgeLine,
74  double positionTolerance,
75  double weightTolerance,
76  int firstIndex,
77  int lastIndex,
78  NodesToRemove& nodesToRemove,
79  int& firstInsideIndex,
80  int& lastInsideIndex) const;
81 
82 private:
83  I_REF(imeas::INumericValue, m_defaultToleranceParamsCompPtr);
84  I_ATTR(QByteArray, m_toleranceParamsIdAttrPtr);
85  I_REF(imath::IUnitInfo, m_distanceUnitInfoCompPtr);
86 };
87 
88 
89 } // namespace iedge
90 
91 
92 #endif // !iedge_CEdgesReductorComp_included
93 
94 
Simple definition macro for a synchronous processor.
void GetReducedLine(const CEdgeLine &edgeLine, double positionTolerance, double weightTolerance, CEdgeLine &result) const
virtual bool DoLinesProcessing(const iprm::IParamsSet *paramsPtr, const CEdgeLineContainer &edgeLines, CEdgeLineContainer &result) const
iproc::TSyncProcessorCompBase< IEdgeLinesProcessor > BaseClass
Describe additional meta information for set of numeric values.
virtual const imath::IUnitInfo & GetNumericValueUnitInfo(int index) const
Get range of possible numeric values for specified list index.
Interface for edge lines processing.
General parameter set containing list of numeric values.
Definition: INumericValue.h:19
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
virtual QString GetNumericValueDescription(int index) const
Get human readable description of numeric value for specified list index.
void GetReducedLines(const CEdgeLineContainer &edgeLines, double positionTolerance, double weightTolerance, CEdgeLineContainer &result) const
int ReduceNodes(const CEdgeLine &edgeLine, double positionTolerance, double weightTolerance, int firstIndex, int lastIndex, NodesToRemove &nodesToRemove, int &firstInsideIndex, int &lastInsideIndex) const
Mark points to remove.
virtual int GetNumericValuesCount() const
Get number of expected numeric values.
virtual QString GetNumericValueName(int index) const
Get human readable name of numeric value for specified list index.

© 2007-2011 Witold Gantzke and Kirill Lepskiy