当前位置: 首页>>代码示例>>C++>>正文


C++ Point2::isFixed方法代码示例

本文整理汇总了C++中Point2::isFixed方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2::isFixed方法的具体用法?C++ Point2::isFixed怎么用?C++ Point2::isFixed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point2的用法示例。


在下文中一共展示了Point2::isFixed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: glPushMatrix

void GLView::drawChoice0() {
  /// drawing example

  glColor3f(0,0.5,1);
  ugl::drawText("drawChoice0: "+_choiceText,0,0);

  glPushMatrix();

  glColor3f(1,0,0);

  vector<Point2> points = curve->getPoints();
  vector<Point2> refPoints = curve->getReferencePoints();
  vector<Point2> *curvePoints = curve->getCurvePoints();

  //User-defined polygon
  glLineWidth(1);
  glColor3f(1,0,0);
  glBegin(GL_LINE_STRIP);
  for(int i = 0; i < points.size(); i++){
      Point2 p = points.at(i);
      glVertex2f(p.getX(),p.getY());
  }
  if(closed){
      if(points.size() > 0){
          glVertex2f(points.at(0).getX(),points.at(0).getY());
      }
  }
  glEnd();

  //User-defined points
  glPointSize(5);
  glColor3f(1,0,0);
  glBegin(GL_POINTS);
  for(int i = 0; i < points.size(); i++){
      Point2 p = points.at(i);
      if(!p.isFixed()){
          glVertex2f(p.getX(),p.getY());
      }
  }
  glEnd();

  //Fixed points
  glPointSize(10);
  glColor3f(1,0,0);
  glBegin(GL_POINTS);
  for(int i = 0; i < points.size(); i++){
      Point2 p = points.at(i);
      if(p.isFixed()){
        glVertex2f(p.getX(),p.getY());
      }

  }
  glEnd();



  //Ref points
  glLineWidth(2);
  glColor3f(0,0,1);
  glBegin(GL_LINE_STRIP);
  for(int i = 0; i < refPoints.size(); i++){
      Point2 p = refPoints.at(i);
      glVertex2f(p.getX(), p.getY());
  }
  if(closed){
      if(refPoints.size() > 0){
          glVertex2f(refPoints.at(0).getX(),refPoints.at(0).getY());
      }
  }
  glEnd();



  //Curve
  glLineWidth(2);
  glColor3f(0,1,0);
  glBegin(GL_LINE_STRIP);
  for(int i = 0; i < curvePoints->size(); i++){
      Point2 p = curvePoints->at(i);
      glVertex2f(p.getX(), p.getY());
  }
  if(closed){
      if(curvePoints->size() > 0){
          glVertex2f(curvePoints->at(0).getX(),curvePoints->at(0).getY());
      }
  }
  glEnd();


  //Curve points
  glPointSize(5);
  glColor3f(0,1,0);
  glBegin(GL_POINTS);
  for(int i = 0; i < curvePoints->size(); i++){
      Point2 p = curvePoints->at(i);
      glVertex2f(p.getX(), p.getY());
      ugl::drawText(""+i,p.getX(),p.getY());
  }

  glEnd();
//.........这里部分代码省略.........
开发者ID:brunez,项目名称:M3DA,代码行数:101,代码来源:GLView.cpp


注:本文中的Point2::isFixed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。