Esempio n. 1
0
void drawPolyLine( VIEW&                  view
                   , const curve_vec_t&     curves
                   , bool                   is_closed
                   , typename VIEW::pixel_t color
                   , std::size_t            line_width )
{
    drawPolyLine( create_ipl_image( view )
                  , curves
                  , is_closed
                  , color
                  , line_width               );
}
void ExternalRenderer::drawLineBlock(TriStorageBlock& block,
                                     unsigned int pass,
                                     vec4x* triangleData,
                                     const MC2BoundingBox& box,
                                     TileMapContainer& tileMapCont,
                                     TileMapFormatDesc& formatDesc,
                                     bool skipOutlines)
{
   if(pass == 0 && skipOutlines) {
      return;
   } 
   if (pass == 1){
      drawPolyLine(triangleData + block.begin,
                   block.size,
                   0,
                   0,
                   pass);
   } else {
      for(std::vector<TriSection>::iterator sectIt = block.primitives.begin();
          sectIt != block.primitives.end(); sectIt++)
      {
         TriSection& section = *sectIt;
         TilePrimitiveFeature& feat = *section.src;

         const CoordsArg* coords = static_cast<const CoordsArg*>(
            feat.getArg(TileArgNames::coords));   

         if ( coords && box.overlaps(coords->getBBox() ) ) {
         
            drawPolyLine(triangleData + section.begin,
                         section.size,
                         section.color1,
                         section.color2,
                         pass);
            feat.setDrawn(true);
         }      
      }         
   }

}
Esempio n. 3
0
void PolyObject::drawScreen(bool drawCenterPoint, float cellsPerMeter, float pixelsPerCell, float worldPanX, float worldPanY) {
    float screenOffsetX = SiteObject::worldToScreen(worldOffsetX, pixelsPerCell, cellsPerMeter);
    float screenOffsetY = SiteObject::worldToScreen(worldOffsetY, pixelsPerCell, cellsPerMeter);


    float siteCenterScreenX = SiteObject::worldToScreen(siteCenterX - worldPanX, pixelsPerCell, cellsPerMeter);
    float siteCenterScreenY = SiteObject::worldToScreen(siteCenterY - worldPanY, pixelsPerCell, cellsPerMeter);

    float polyOriginX = siteCenterScreenX + screenOffsetX;
    float polyOriginY = siteCenterScreenY - screenOffsetY;

    // if the object is selected, draw the outline first
    if(selected) {
        int outline = 4;
        fl_line_style(FL_SOLID, 5 + outline);
        fl_color(255, 0, 0);
        drawPolyLine(polyOriginX, polyOriginY, pixelsPerCell, cellsPerMeter);
    }

    fl_line_style(FL_SOLID, 5);
    fl_color(r, g, b);

    drawPolyLine(polyOriginX, polyOriginY, pixelsPerCell, cellsPerMeter);

    if(drawCenterPoint) {
        fl_color(255, 0, 0);

        if(recalculateCenterPoint) {
            calculateCenterPoint();
            recalculateCenterPoint = false;
        }

        float centerPointScreenOffsetX = SiteObject::worldToScreen(centerPointWorldOffsetX, pixelsPerCell, cellsPerMeter);
        float centerPointScreenOffsetY = SiteObject::worldToScreen(centerPointWorldOffsetY, pixelsPerCell, cellsPerMeter);

        fl_circle(siteCenterScreenX + centerPointScreenOffsetX, siteCenterScreenY - centerPointScreenOffsetY, 1);
    }
}
Esempio n. 4
0
	void GUICanvas::drawLine(const Vector2I& a, const Vector2I& b, const Color& color)
	{
		drawPolyLine({ a, b }, color);
	}