Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 type wrong for bounds_*(piecewise)

closed
None
5
2008-06-08
2007-11-06
Nathan Hurst
No

(01:15:27 PM) Johan: njh: I cannot calculate bounds of a pwd2
(01:15:57 PM) Johan: This does not compile:
Piecewise<D2<SBasis> > uskeleton;
Rect skelbounds = bounds_exact(uskeleton);

It seems that the definition for bounds_exact(Piecewise<T>) is wrong in that it expects the return type is always an interval, rather than a rect in the case of a pw<d2>.

Discussion

  • Nathan Hurst
    Nathan Hurst
    2007-11-06

    • assigned_to: nobody --> mgsloan
     
  • Johan Engelen
    Johan Engelen
    2007-11-06

    Logged In: YES
    user_id=1578747
    Originator: NO

    It is not completely fixed yet.

    This is the code:
    105: Piecewise<D2<SBasis> > uskeleton = arc_length_parametrization(Piecewise<D2<SBasis> >(bend_path),2,.1);
    106: Rect skelbounds = bounds_exact(uskeleton);

    And this the compiler error:

    Make error line 195: problem compiling: src/2geom/rect.h: In function 'typename
    Geom::FragmentConcept<T>::BoundsType Geom::bounds_exact(const Geom::Piecewise<T>
    &) [with T = Geom::D2<Geom::SBasis>]':
    src/live_effects/lpe-pathalongpath.cpp:106: instantiated from here
    src/2geom/rect.h:57: error: 'Geom::D2<Geom::Interval>::D2()' is private
    src/2geom/piecewise.h:231: error: within this context

     
  • Nathan Hurst
    Nathan Hurst
    2008-06-08

    • status: open --> closed
     
  • Nathan Hurst
    Nathan Hurst
    2008-06-08

    Logged In: YES
    user_id=73796
    Originator: YES

    It works now! For example, look at src/toys/squiggles.cpp:
    r = bounds_exact(pwc);