示例#1
0
VisualLine::VisualLine(const VisualLine& other)
    : start(other.start), end(other.end), left(other.left), right(other.right),
      bottom(other.bottom), top(other.top), points(other.points),
      angle(other.angle), a(other.a), b(other.b), length(other.length),
      color(other.color), colorStr(other.colorStr),
      avgVerticalWidth(other.avgVerticalWidth),
      avgHorizontalWidth(other.avgHorizontalWidth),
      thinnestHorPoint(other.thinnestHorPoint),
      thickestHorPoint(other.thickestHorPoint),
      thinnestVertPoint(other.thinnestVertPoint),
      thickestVertPoint(other.thickestVertPoint),
      distance(other.getDistance()), bearing(other.getBearing()),
      distanceSD(other.getDistanceSD()), bearingSD(other.getBearingSD()),
      possibleLines(ConcreteLine::concreteLines)
{
}
示例#2
0
VisualLine::VisualLine(const VisualLine& other)
    : VisualLandmark<lineID>(other),
      start(other.start), end(other.end), leftBound(other.leftBound),
      rightBound(other.rightBound),
      bottomBound(other.bottomBound),
      topBound(other.topBound),
      points(other.points),
      angle(other.angle), length(other.length),
      a(other.a), b(other.b),
      color(other.color), colorStr(other.colorStr),
      avgVerticalWidth(other.avgVerticalWidth),
      avgHorizontalWidth(other.avgHorizontalWidth),
      thinnestHorPoint(other.getThinnestHorizontalPoint()),
      thickestHorPoint(other.getThickestHorizontalPoint()),
      thinnestVertPoint(other.getThinnestVerticalPoint()),
      thickestVertPoint(other.getThickestVerticalPoint()),
      distance(other.getDistance()), bearing(other.getBearing()),
      distanceSD(other.getDistanceSD()), bearingSD(other.getBearingSD()),
      ccLine(other.getCCLine()),
      possibleLines(other.getPossibleLines())
{
}
示例#3
0
extern void
PyVisualLine_update (PyVisualLine *self, const VisualLine &line)
{
    Py_XDECREF(self->x1);
    self->x1 = PyInt_FromLong(line.start.x);

    Py_XDECREF(self->y1);
    self->y1 = PyInt_FromLong(line.start.y);

    Py_XDECREF(self->x2);
    self->x2 = PyInt_FromLong(line.end.x);

    Py_XDECREF(self->y2);
    self->y2 = PyInt_FromLong(line.end.y);

    Py_XDECREF(self->slope);
    self->slope = PyFloat_FromDouble(line.getSlope());

    Py_XDECREF(self->length);
    self->length = PyFloat_FromDouble(line.length);
}
示例#4
0
void checkLines(vector<Observation> &Z_t, PoseEst myPos)
{

    // Check concrete lines
	for (int i = 0; i < ConcreteLine::NUM_LINES; ++i) {
		const ConcreteLine *toView = ConcreteLine::concreteLines()[i];
		LineLandmark ll(toView->getFieldX1(),
						toView->getFieldY1(),
						toView->getFieldX2(),
						toView->getFieldY2());
		std::pair<float,float> lineDelta =
			findClosestLinePointCartesian(ll, myPos.x, myPos.y, myPos.h);

		const float distance = hypot(lineDelta.first, lineDelta.second);
		const float bearing = subPIAngle(safe_atan2(lineDelta.second, lineDelta.first) - myPos.h);

		const lineID id = toView->getID();
		list<const ConcreteLine*> toUse;

		const ConcreteLine * line;
		switch(id) {
		case BLUE_GOAL_ENDLINE:
			line = &ConcreteLine::blue_goal_endline();
			break;
		case YELLOW_GOAL_ENDLINE:
			line = &ConcreteLine::yellow_goal_endline();
			break;
		case TOP_SIDELINE:
			line = &ConcreteLine::top_sideline();
			break;
		case BOTTOM_SIDELINE:
			line = &ConcreteLine::bottom_sideline();
			break;
		case BLUE_GOALBOX_TOP_LINE:
			line = &ConcreteLine::blue_goalbox_top_line();
			break;
		case BLUE_GOALBOX_LEFT_LINE:
			line = &ConcreteLine::blue_goalbox_left_line();
			break;
		case BLUE_GOALBOX_RIGHT_LINE:
			line = &ConcreteLine::blue_goalbox_right_line();
			break;
		case YELLOW_GOALBOX_TOP_LINE:
			line = &ConcreteLine::yellow_goalbox_top_line();
			break;
		case YELLOW_GOALBOX_LEFT_LINE:
			line = &ConcreteLine::yellow_goalbox_left_line();
			break;
		case YELLOW_GOALBOX_RIGHT_LINE:
		case UNKNOWN_LINE:
		case SIDE_OR_ENDLINE:
		case SIDELINE_LINE:
		case ENDLINE_LINE:
		case GOALBOX_LINE:
		case GOALBOX_SIDE_LINE:
		case GOALBOX_TOP_LINE:
		default:
			line = &ConcreteLine::yellow_goalbox_right_line();
			break;
		}
		toUse.assign(1, line);
		VisualLine vl = VisualLine(distance, bearing);
		vl.setPossibleLines(toUse);
		vl.setID(id);
		Observation seen(vl);
		Z_t.push_back(seen);
	}
}
void TreePropertiesDlg::Apply()
{
	// *** Set properties based on state of controls in General page
	m_treeLayer->SetName(m_txtLayerName->GetValue().c_str());
	m_treeLayer->SetDescription(m_txtLayerDescription->GetValue().c_str());
	m_treeLayer->SetAuthours(m_txtAuthours->GetValue().c_str());

	// *** Set properties based on state of control in Symbology page
	GeoTreeViewPtr geoTreeView = m_treeLayer->GetGeoTreeView();

	if(m_cboTreeLayout->GetValue() == _T("3D slanted cladogram"))
		geoTreeView->SetLayout(GeoTreeView::SLANTED_CLADOGRAM_3D);
	else if(m_cboTreeLayout->GetValue() == _T("3D cladogram"))
		geoTreeView->SetLayout(GeoTreeView::CLADOGRAM_3D);
	else if(m_cboTreeLayout->GetValue() == _T("3D slanted phylogram"))
		geoTreeView->SetLayout(GeoTreeView::SLANTED_PHYLOGRAM_3D);
	else if(m_cboTreeLayout->GetValue() == _T("2D slanted cladogram"))
		geoTreeView->SetLayout(GeoTreeView::SLANTED_CLADOGRAM_2D);
	else if(m_cboTreeLayout->GetValue() == _T("2D cladogram"))
		geoTreeView->SetLayout(GeoTreeView::CLADOGRAM_2D);
	else if(m_cboTreeLayout->GetValue() == _T("2D phylogram"))
		geoTreeView->SetLayout(GeoTreeView::PHYLOGRAM_2D);
	else if(m_cboTreeLayout->GetValue() == _T("Elliptical layout"))
		geoTreeView->SetLayout(GeoTreeView::ELLIPSE_QUADRANT);

	geoTreeView->SetLineThickness(m_spinTreeThickness->GetValue());

	geoTreeView->SetHeight(StringTools::ToDouble(std::wstring(m_txtTreeHeight->GetValue())));

	if(m_cbo2dOrientation->GetValue() == _T("Vertical"))
		geoTreeView->SetOrientation(GeoTreeView::VERTICAL);
	else if(m_cbo2dOrientation->GetValue() == _T("Horizontal"))
		geoTreeView->SetOrientation(GeoTreeView::HORIZONTAL);

	geoTreeView->SetLayoutPrimativeVisibility(m_chkDrawLayoutPrimative->GetValue());

	geoTreeView->SetColour(Colour(m_colourTree->GetColour()));

	if(m_cboTreeColourStyle->GetValue() == _T("Single colour"))
		geoTreeView->SetTreeColourStyle(GeoTreeView::COLOUR_SINGLE);
	else if(m_cboTreeColourStyle->GetValue() == _T("Propogate discrete colours"))
		geoTreeView->SetTreeColourStyle(GeoTreeView::COLOUR_DISCRETE);
	else if(m_cboTreeColourStyle->GetValue() == _T("Propogate continuous colours"))
		geoTreeView->SetTreeColourStyle(GeoTreeView::COLOUR_CONTINUOUS);

	geoTreeView->SetLeafNodeSize(m_spinLeafNodeSize->GetValue());
	geoTreeView->SetInternalNodeSize(m_spinInternalNodeSize->GetValue());

	geoTreeView->SetLeafNodeBorderSize(m_spinLeafNodeBorderSize->GetValue());
	geoTreeView->SetInternalNodeBorderSize(m_spinInternalNodeBorderSize->GetValue());
	geoTreeView->SetGeoPtsBorderSize(m_spinGeoPointBorderSize->GetValue());
	geoTreeView->SetBranchBorderSize(m_spinBranchBorderSize->GetValue());
	geoTreeView->SetLocationLineBorderSize(m_spinLocationLineBorderSize->GetValue());
	geoTreeView->SetCorrelationLineBorderSize(m_spinCorrelationLineBorderSize->GetValue());

	geoTreeView->SetLeafNodeBorderColour(Colour(m_colourLeafNodeBorder->GetColour()));
	geoTreeView->SetInternalNodeBorderColour(Colour(m_colourInternalNodeBorder->GetColour()));
	geoTreeView->SetGeoPtsBorderColour(Colour(m_colourGeoPointBorder->GetColour()));
	geoTreeView->SetBranchBorderColour(Colour(m_colourBranchBorder->GetColour()));
	geoTreeView->SetLocationLineBorderColour(Colour(m_colourLocationLineBorder->GetColour()));
	geoTreeView->SetCorrelationLineBorderColour(Colour(m_colourCorrelationLineBorder->GetColour()));

	// set location line properties
	geoTreeView->LocationLines().SetThickness(m_spinLocationLineThickness->GetValue());

	geoTreeView->LocationLines().SetVisibility(true);
	if(m_cboLocationLineStyle->GetValue() == _T("Solid"))
		geoTreeView->LocationLines().SetLineStyle(VisualLine::SOLID);
	else if(m_cboLocationLineStyle->GetValue() == _T("Short dash"))
		geoTreeView->LocationLines().SetLineStyle(VisualLine::SHORT_DASH);
	else if(m_cboLocationLineStyle->GetValue() == _T("Long dash"))
		geoTreeView->LocationLines().SetLineStyle(VisualLine::LONG_DASH);
	else if(m_cboLocationLineStyle->GetValue() == _T("Hidden"))
	{
		geoTreeView->LocationLines().SetLineStyle(VisualLine::HIDDEN);
		geoTreeView->LocationLines().SetVisibility(false);
	}

	// set correlation line properties
	geoTreeView->CorrelationLines().SetThickness(m_spinCorrelationLineThickness->GetValue());

	geoTreeView->CorrelationLines().SetVisibility(true);
	if(m_cboCorrelationLineStyle->GetValue() == _T("Solid"))
		geoTreeView->CorrelationLines().SetLineStyle(VisualLine::SOLID);
	else if(m_cboCorrelationLineStyle->GetValue() == _T("Short dash"))
		geoTreeView->CorrelationLines().SetLineStyle(VisualLine::SHORT_DASH);
	else if(m_cboCorrelationLineStyle->GetValue() == _T("Long dash"))
		geoTreeView->CorrelationLines().SetLineStyle(VisualLine::LONG_DASH);
	else if(m_cboCorrelationLineStyle->GetValue() == _T("Hidden"))
	{
		geoTreeView->CorrelationLines().SetLineStyle(VisualLine::HIDDEN);
		geoTreeView->CorrelationLines().SetVisibility(false);
	}

	// set internal 3d drop line properties
	VisualLine internalDropLineStyle = geoTreeView->Get3dInternalDropLineStyle();
	internalDropLineStyle.SetSize(m_spinInternalDropLineThickness->GetValue());
	internalDropLineStyle.SetColour(Colour(m_colourInternalDropLine->GetColour()));

	internalDropLineStyle.SetVisibility(true);
	if(m_cboInternalDropLineStyle->GetValue() == _T("Solid"))
		internalDropLineStyle.SetLineStyle(VisualLine::SOLID);
	else if(m_cboInternalDropLineStyle->GetValue() == _T("Short dash"))
		internalDropLineStyle.SetLineStyle(VisualLine::SHORT_DASH);
	else if(m_cboInternalDropLineStyle->GetValue() == _T("Long dash"))
		internalDropLineStyle.SetLineStyle(VisualLine::LONG_DASH);
	else if(m_cboInternalDropLineStyle->GetValue() == _T("Hidden"))
	{
		internalDropLineStyle.SetLineStyle(VisualLine::HIDDEN);
		internalDropLineStyle.SetVisibility(true);
	}

	geoTreeView->Set3dInternalDropLineStyle(internalDropLineStyle);

	// set leaf 3d drop line properties
	VisualLine leafDropLineStyle = geoTreeView->Get3dLeafDropLineStyle();

	leafDropLineStyle.SetVisibility(true);
	if(m_cboLeafDropLineStyle->GetValue() == _T("Solid"))
		leafDropLineStyle.SetLineStyle(VisualLine::SOLID);
	else if(m_cboLeafDropLineStyle->GetValue() == _T("Short dash"))
		leafDropLineStyle.SetLineStyle(VisualLine::SHORT_DASH);
	else if(m_cboLeafDropLineStyle->GetValue() == _T("Long dash"))
		leafDropLineStyle.SetLineStyle(VisualLine::LONG_DASH);
	else if(m_cboLeafDropLineStyle->GetValue() == _T("Hidden"))
	{
		leafDropLineStyle.SetLineStyle(VisualLine::HIDDEN);
		leafDropLineStyle.SetVisibility(true);
	}

	geoTreeView->Set3dLeafDropLineStyle(leafDropLineStyle);

	// set geography line properties
	geoTreeView->SetGeographyLineOffsetPercentage(m_spinGeoLineOffset->GetValue() / 100.0);
	geoTreeView->GeographyLine().SetSize(m_spinGeoLineThickness->GetValue());
	geoTreeView->GeographyLine().SetColour(Colour(m_colourGeoLine->GetColour()));

	geoTreeView->GeographyLine().SetVisibility(true);
	if(m_cboGeoLineStyle->GetValue() == _T("Solid"))
		geoTreeView->GeographyLine().SetLineStyle(VisualLine::SOLID);
	else if(m_cboGeoLineStyle->GetValue() == _T("Short dash"))
		geoTreeView->GeographyLine().SetLineStyle(VisualLine::SHORT_DASH);
	else if(m_cboGeoLineStyle->GetValue() == _T("Long dash"))
		geoTreeView->GeographyLine().SetLineStyle(VisualLine::LONG_DASH);
	else if(m_cboGeoLineStyle->GetValue() == _T("Hidden"))
	{
		geoTreeView->GeographyLine().SetLineStyle(VisualLine::HIDDEN);
		geoTreeView->GeographyLine().SetVisibility(true);
	}

	geoTreeView->SetOptimizeTopology(m_chkOptimizeLeafNodes->GetValue());

	// geographic point properties
	geoTreeView->GeographicPoints().SetSize(m_spinGeoPointSize->GetValue());

	geoTreeView->GeographicPoints().SetVisibility(m_chkDrawGeoPoint->GetValue());
	geoTreeView->SetSpreadGeographyPts(m_chkEvenlySpeadGeoPts->GetValue());

	geoTreeView->SetGeographicAxisVisibility(m_chkDrawGeoAxis->GetValue());

	// *** Set properties based on state of control in Label page
	geoTreeView->SetFontSize(m_spinLabelSize->GetValue());

	geoTreeView->SetFontColour(Colour(m_colourLabel->GetColour()));

	geoTreeView->SetLabelVisibility(m_chkShowLabels->GetValue());

	geoTreeView->ForceTreeLayout();

	App::Inst().SetSaveStatus( SESSION_NOT_SAVED );
	App::Inst().GetViewport()->Refresh( false );
	App::Inst().GetLayerTreeController()->SetName( m_treeLayer, m_treeLayer->GetName() );
}