本文整理汇总了C++中PointPtr::set_extrude方法的典型用法代码示例。如果您正苦于以下问题:C++ PointPtr::set_extrude方法的具体用法?C++ PointPtr::set_extrude怎么用?C++ PointPtr::set_extrude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointPtr
的用法示例。
在下文中一共展示了PointPtr::set_extrude方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createTimespanPlacemark
/**
* @brief KmlExport::createTimespanPlacemark Creates a timespan placemark, which allows the
* trajectory to be played forward in time. The placemark also contains pertinent data about
* the vehicle's state at that timespan
* @param timestampPoint
* @param lastPlacemarkTime
* @param newPlacemarkTime
* @return Returns the placemark containing the timespan
*/
PlacemarkPtr KmlExport::createTimespanPlacemark(const LLAVCoordinates ×tampPoint, quint32 lastPlacemarkTime, quint32 newPlacemarkTime)
{
// Create coordinates
CoordinatesPtr coordinates = factory->CreateCoordinates();
coordinates->add_latlngalt(timestampPoint.latitude, timestampPoint.longitude, timestampPoint.altitude);
// Create point, using previous coordinates
PointPtr point = factory->CreatePoint();
point->set_extrude(true); // Extrude to ground
point->set_altitudemode(kmldom::ALTITUDEMODE_ABSOLUTE);
point->set_coordinates(coordinates);
// Create the timespan
TimeSpanPtr timeSpan = factory->CreateTimeSpan();
QDateTime startTime = QDateTime::currentDateTimeUtc().addMSecs(lastPlacemarkTime); // FIXME: Make it a function of the realtime preferably gotten from the GPS
QDateTime endTime = QDateTime::currentDateTimeUtc().addMSecs(newPlacemarkTime);
timeSpan->set_begin(startTime.toString(dateTimeFormat).toStdString());
timeSpan->set_end(endTime.toString(dateTimeFormat).toStdString());
// Create an icon style. This arrow icon will be rotated and colored to represent velocity
AttitudeActual::DataFields attitudeActualData = attitudeActual->getData();
AirspeedActual::DataFields airspeedActualData = airspeedActual->getData();
IconStylePtr iconStyle = factory->CreateIconStyle();
iconStyle->set_color(mapVelocity2Color(airspeedActualData.CalibratedAirspeed));
iconStyle->set_heading(attitudeActualData.Yaw + 180); //Adding 180 degrees because the arrow art points down, i.e. south.
// Create a line style. This defines the style for the "legs" connecting the points to the ground.
LineStylePtr lineStyle = factory->CreateLineStyle();
lineStyle->set_color(mapVelocity2Color(timestampPoint.groundspeed));
// Link the style to the icon
StylePtr style = factory->CreateStyle();
style->set_linestyle(lineStyle);
style->set_iconstyle(iconStyle);
// Generate the placemark with all above attributes
PlacemarkPtr placemark = factory->CreatePlacemark();
placemark->set_geometry(point);
placemark->set_timeprimitive(timeSpan);
placemark->set_name(QString("%1").arg(timeStamp / 1000.0).toStdString());
placemark->set_visibility(true);
// Set the placemark to use the custom rotated arrow style
placemark->set_styleurl("#directiveArrowStyle");
placemark->set_styleselector(style);
// Add a nice description to the placemark
placemark->set_description(informationString.toStdString());
return placemark;
}
示例2: ogr2extrude_rec
void ogr2extrude_rec (
int nExtrude,
GeometryPtr poKmlGeometry )
{
PointPtr poKmlPoint;
LineStringPtr poKmlLineString;
PolygonPtr poKmlPolygon;
MultiGeometryPtr poKmlMultiGeometry;
size_t nGeom;
size_t i;
switch ( poKmlGeometry->Type ( ) ) {
case kmldom::Type_Point:
poKmlPoint = AsPoint ( poKmlGeometry );
poKmlPoint->set_extrude ( nExtrude );
break;
case kmldom::Type_LineString:
poKmlLineString = AsLineString ( poKmlGeometry );
poKmlLineString->set_extrude ( nExtrude );
break;
case kmldom::Type_LinearRing:
break;
case kmldom::Type_Polygon:
poKmlPolygon = AsPolygon ( poKmlGeometry );
poKmlPolygon->set_extrude ( nExtrude );
break;
case kmldom::Type_MultiGeometry:
poKmlMultiGeometry = AsMultiGeometry ( poKmlGeometry );
nGeom = poKmlMultiGeometry->get_geometry_array_size ( );
for ( i = 0; i < nGeom; i++ ) {
ogr2extrude_rec ( nExtrude,
poKmlMultiGeometry->
get_geometry_array_at ( i ) );
}
break;
default:
break;
}
}