Esempio n. 1
0
// 8-Feb-2013 Dale Fugier, http://mcneel.myjetbrains.com/youtrack/issue/RH-15661
RH_C_FUNCTION bool RHC_RhinoCreateSpiral1( const ON_Curve* pRail, double rail_t0, double rail_t1, ON_3DPOINT_STRUCT radius_point, double pitch, double turn_count, double radius0, double radius1, int points_per_turn, ON_NurbsCurve* pCurve )
{
  bool rc = false;
  if( pRail && pCurve )
  {
    ON_3dPoint radiusPoint(radius_point.val);
    rc = RhinoCreateSpiral( *pRail, rail_t0, rail_t1, radiusPoint, pitch, turn_count, radius0, radius1, points_per_turn, *pCurve );
    if( rc && pCurve )
      rc = pCurve->IsValid() ? true : false;
  }
  return rc;
}
Esempio n. 2
0
void QgsMapToolSelectRadius::setRadiusRubberBand( QgsPoint & radiusEdge )
{
  double r = sqrt( mRadiusCenter.sqrDist( radiusEdge ) );
  mRubberBand->reset( QGis::Polygon );
  for ( int i = 0; i <= RADIUS_SEGMENTS; ++i )
  {
    double theta = i * ( 2.0 * M_PI / RADIUS_SEGMENTS );
    QgsPoint radiusPoint( mRadiusCenter.x() + r * cos( theta ),
                          mRadiusCenter.y() + r * sin( theta ) );
    mRubberBand->addPoint( radiusPoint, false );
  }
  mRubberBand->closePoints( true );
}
Esempio n. 3
0
// 8-Feb-2013 Dale Fugier, http://mcneel.myjetbrains.com/youtrack/issue/RH-15661
RH_C_FUNCTION bool RHC_RhinoCreateSpiral0( ON_3DPOINT_STRUCT axis_start, ON_3DVECTOR_STRUCT axis_dir, ON_3DPOINT_STRUCT radius_point, double pitch, double turn_count, double radius0, double radius1, ON_NurbsCurve* pCurve )
{
  bool rc = false;
  if( pCurve )
  {
    ON_3dPoint axisStart(axis_start.val);
    ON_3dVector axisDir(axis_dir.val);
    ON_3dPoint radiusPoint(radius_point.val);
    rc = RhinoCreateSpiral( axisStart, axisDir, radiusPoint, pitch, turn_count, radius0, radius1, *pCurve );
    if( rc && pCurve )
      rc = pCurve->IsValid() ? true : false;
  }
  return rc;
}