Beispiel #1
0
void trend::TrendBase::grcwire (int4b* pdata, unsigned psize, WireWidth width)
{
    // first check whether to draw only the center line
    DBbox wsquare = DBbox(TP(0,0),TP(width,width));
    bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit());
    _grcLayer->wire(pdata, psize, width, center_line_only);
}
Beispiel #2
0
void trend::TrendBase::wiret(const PointVector& pdata, WireWidth width)
{
    // first check whether to draw only the center line
    DBbox wsquare = DBbox(TP(0,0),TP(width,width));
    bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit());
    _clayer->wire(pdata, width, center_line_only, *_rmm);
}
Beispiel #3
0
void trend::TrendBase::wirem(int4b* pdata, unsigned psize, WireWidth width, const SGBitSet* psel)
{
    // first check whether to draw only the center line
    DBbox wsquare = DBbox(TP(0,0),TP(width,width));
    bool center_line_only = !wsquare.visible(topCTM() * scrCTM(), visualLimit());
    _clayer->wire(pdata, psize, width, center_line_only,psel,*_rmm);
}
/*! A temporary Draw (during move/copy operations) of the container contents
 on the screen using the virtual quadTree::tmp_draw() method of the 
 parent object. */
void laydata::tdtlayer::motion_draw(const layprop::DrawProperties& drawprop,
                                                 ctmqueue& transtack) const {
   // check the entire layer for clipping...
   DBbox clip = drawprop.clipRegion();
   if (empty()) return;
   DBbox areal = overlap().overlap(transtack.front());
   if      ( clip.cliparea(areal) == 0       ) return;
   else if (!areal.visible(drawprop.ScrCTM())) return;
   quadTree::motion_draw(drawprop, transtack);
}
short laydata::quadTree::clip_type(tenderer::TopRend& rend) const
{
   if (empty()) return 0;
   // check the entire holder for clipping...
   DBbox clip = rend.clipRegion();
   DBbox areal = _overlap.overlap(rend.topCTM());
   float clip_area = clip.cliparea(areal);
   if ( ( 0.0 == clip_area ) || (!areal.visible(rend.ScrCTM())) ) return 0;
   if (0.0 < clip_area) return 1;
   else return -1;
}
Beispiel #6
0
bool laydata::DrawIterator<DataT>::secureNonEmptyDown()
{
   assert(_drawprop);
   DBbox clip = _drawprop->clipRegion();
   DBbox areal = Iterator<DataT>::_cQuad->_overlap.overlap(_ctm);
   if      (0ll == clip.cliparea(areal)      ) return false;
   else if (!areal.visible(_drawprop->scrCtm(), _drawprop->visualLimit())) return false;
   while (0 == Iterator<DataT>::_cQuad->_props._numObjects)
   {
      return this->nextSubQuad(0,Iterator<DataT>::_cQuad->_props.numSubQuads());
   }
   Iterator<DataT>::_cData = 0;
   return true;
}
/*! Temporary draw of the container contents on the screen using the virtual 
tmp_draw methods of the tdtddata objects. This happens only if 
the current quadTree object is visible. Current clip region data is
obtained from LayoutCanvas. In a sence this method is the same as openGL_draw
without fill and not handling selected shapes*/
void laydata::quadTree::motion_draw(const layprop::DrawProperties& drawprop,
                                                   ctmqueue& transtack) const {
   if (empty()) return;
   // check the entire holder for clipping...
   DBbox clip = drawprop.clipRegion();
   DBbox areal = _overlap.overlap(transtack.front());
   if      (clip.cliparea(areal) == 0        ) return;
   else if (!areal.visible(drawprop.ScrCTM())) return;
   tdtdata* wdt = _first;
   while(wdt) {
      wdt->motion_draw(drawprop, transtack, NULL);
      wdt = wdt->next();
   }
   for(byte i = 0; i < 4; i++) 
      if (_quads[i]) _quads[i]->motion_draw(drawprop, transtack);
}
/*! Draw the contents of the container on the screen using the virtual 
openGL_draw methods of the tdtddata objects. This happens only if 
the current quadTree object is visible. Current clip region data is
obtained from LayoutCanvas. Draws also the select marks in case shape is
selected. \n This is the cherry of the quadTree algorithm cake*/
void laydata::quadTree::openGL_draw(layprop::DrawProperties& drawprop,
                                                   const dataList* slst, bool fill) const
{
   if (empty()) return;
   // check the entire holder for clipping...
   DBbox clip = drawprop.clipRegion();
   DBbox areal = _overlap.overlap(drawprop.topCTM()); 
   if      ( clip.cliparea(areal) == 0       ) return;
   else if (!areal.visible(drawprop.ScrCTM())) return;
   tdtdata* wdt = _first;
   // The drawing will be faster like this for the cells without selected shapes
   // that will be the wast majority of the cases. A bit bigger code though.
   // Seems the bargain is worth it.
   if (slst)
   {
      while(wdt)
      {
         pointlist points;
         // precalculate drawing data
         wdt->openGL_precalc(drawprop, points);
         if (0 != points.size())
         {
            // draw the shape fill (contents of refs, arefs and texts)
            if (fill)  wdt->openGL_drawfill(drawprop, points);
            // draw the outline of the shapes and overlapping boxes 
            wdt->openGL_drawline(drawprop, points);
            if ((sh_selected == wdt->status()) || (sh_partsel == wdt->status()))
            {
               drawprop.setLineProps(true);
               if       (sh_selected == wdt->status())
                  wdt->openGL_drawsel(points, NULL);
               else if  (sh_partsel  == wdt->status())
               {
                  dataList::const_iterator SI;
                  for (SI = slst->begin(); SI != slst->end(); SI++)
                     if (SI->first == wdt) break;
                  assert(SI != slst->end());
                  wdt->openGL_drawsel(points, &(SI->second));
               }
               drawprop.setLineProps(false);
            }
            wdt->openGL_postclean(drawprop, points);
         }
         wdt = wdt->next();
      }
   }
   else
   {
      // if there are no selected shapes
      while(wdt)
      {
         pointlist points;
         // precalculate drawing data
         wdt->openGL_precalc(drawprop, points);
         // draw the shape fill (contents of refs, arefs and texts)
         if (fill)  wdt->openGL_drawfill(drawprop, points);
         // draw the outline of the shapes and overlapping boxes
         wdt->openGL_drawline(drawprop, points);
         // clean-up
         wdt->openGL_postclean(drawprop, points);
         wdt = wdt->next();
      }
   }

   for(byte i = 0; i < 4; i++)
      if (_quads[i]) _quads[i]->openGL_draw(drawprop, slst, fill);
}