Complex Measurement
Functional Guide | Reference: Load, GetNumDaughters, Process, GetDaughter, GetShapeNamed
////////////////////////////////////////////////////////////
// This code snippet shows how to trigger the measurement //
// of a whole gauge hierarchy and retrieve the results. //
////////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage;
// EWorldShape constructor
EWorldShape worldShape;
// Load the EWorldShape together with its daughters
worldShape.Load("myWorldShape.gge", true);
// Retrieve the number of worldShape's daughters
int numDaughters= worldShape.GetNumDaughters();
// ...
// Trigger the measurement of all the
// gauges attached to the EWorldShape
worldShape.Process(&srcImage, true);
// Retrieve the measurement result of
// the first daughter (a rectangle gauge)
ERectangleGauge* rectangleGauge= (ERectangleGauge*)worldShape.GetDaughter(0);
float sizeX= rectangleGauge->GetMeasuredRectangle().GetSizeX();
// Retrieve the measurement result of a
// daughter gauge called "myCircleGauge1"
ECircleGauge* circleGauge= (ECircleGauge*)worldShape.GetShapeNamed("myCircleGauge1");
EPoint center= circleGauge->GetMeasuredCircle().GetCenter();
'////////////////////////////////////////////////////////////
'// This code snippet shows how to trigger the measurement //
'// of a whole gauge hierarchy and retrieve the results. //
'////////////////////////////////////////////////////////////
' Image constructor
Dim srcImage As New EImageBW8
' EWorldShape constructor
Dim worldShape As New EWorldShape
' Load the EWorldShape together with its daughters
worldShape.Load "myWorldShape.gge", True
' Retrieve the number of worldShape's daughters
Dim numDaughters As Long
numDaughters = worldShape.numDaughters
' ...
' Trigger the measurement of all the
' gauges attached to the EWorldShape
worldShape.Process srcImage, True
' Retrieve the measurement result of
' the first daughter (a rectangle gauge)
Dim rectangleGauge As ERectangleGauge
Set rectangleGauge = worldShape.GetDaughter(0)
Dim sizeX As Single
sizeX = rectangleGauge.MeasuredRectangle.sizeX
' Retrieve the measurement result of a
' daughter gauge called "myCircleGauge1"
Dim circleGauge As ECircleGauge
Set circleGauge = worldShape.GetShapeNamed("myCircleGauge1")
Dim center As EPoint
Set center = circleGauge.MeasuredCircle.center
////////////////////////////////////////////////////////////
// This code snippet shows how to trigger the measurement //
// of a whole gauge hierarchy and retrieve the results. //
////////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage= new EImageBW8();
// EWorldShape constructor
EWorldShape worldShape= new EWorldShape();
// Load the EWorldShape together with its daughters
worldShape.Load("myWorldShape.gge", true);
// Retrieve the number of worldShape's daughters
int numDaughters= worldShape.NumDaughters;
// ...
// Trigger the measurement of all the
// gauges attached to the EWorldShape
worldShape.Process(srcImage, true);
// Retrieve the measurement result of
// the first daughter (a rectangle gauge)
ERectangleGauge rectangleGauge= (ERectangleGauge)worldShape.GetDaughter(0);
float sizeX= rectangleGauge.MeasuredRectangle.SizeX;
// Retrieve the measurement result of a
// daughter gauge called "myCircleGauge1"
ECircleGauge circleGauge= (ECircleGauge)worldShape.GetShapeNamed("myCircleGauge1");
EPoint center= circleGauge.MeasuredCircle.Center;