Skip to content

Commit

Permalink
Merge pull request #9 from kerautret/FixPTMesh
Browse files Browse the repository at this point in the history
Fix pt mesh
  • Loading branch information
rolanddenis committed Mar 14, 2019
2 parents 34a3712 + b2b7004 commit dafb5d8
Show file tree
Hide file tree
Showing 7 changed files with 439 additions and 434 deletions.
35 changes: 18 additions & 17 deletions examples/geometry/curves/exampleAlphaThickSegment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,44 @@ int main( )

//construction of an AlphaThickSegmentComputer2D from the freemanchain iterator
AlphaThickSegmentComputer2D anAlphaSegment(15), anAlphaSegment2(5), anAlphaSegment3(2);
anAlphaSegment.init(fc.begin());
while (anAlphaSegment.end() != fc.end() &&
anAlphaSegment.init(fc.begin());
while (anAlphaSegment.end() != fc.end() &&
anAlphaSegment.extendFront()) {
}
aBoard << anAlphaSegment;

anAlphaSegment2.init(fc.begin());
while (anAlphaSegment2.end() != fc.end() && anAlphaSegment2.extendFront()) {
}
aBoard << CustomStyle( anAlphaSegment2.className(), new CustomColors( DGtal::Color::Blue, DGtal::Color::None ) );
aBoard << anAlphaSegment2;

aBoard << anAlphaSegment;
// Example of thickness definition change: usin the euclidean thickness definition.
//! [exampleAlphaThickSegmentEuclDef]
AlphaThickSegmentComputer2D anAlphaSegment2Eucl(5, functions::Hull2D::EuclideanThickness);
//! [exampleAlphaThickSegmentEuclDef]

anAlphaSegment2Eucl.init(fc.begin());
while (anAlphaSegment2Eucl.end() != fc.end() &&
while (anAlphaSegment2Eucl.end() != fc.end() &&
anAlphaSegment2Eucl.extendFront()) {
}

aBoard << CustomStyle( anAlphaSegment2Eucl.className(),
new CustomColors( DGtal::Color(20, 250, 255), DGtal::Color::None ) );
aBoard << CustomStyle( anAlphaSegment2Eucl.className(),
new CustomColors( DGtal::Color(20, 250, 255), DGtal::Color::None ) );
aBoard << anAlphaSegment2Eucl;



anAlphaSegment2.init(fc.begin());
while (anAlphaSegment2.end() != fc.end() && anAlphaSegment2.extendFront()) {
}
aBoard << CustomStyle( anAlphaSegment2.className(), new CustomColors( DGtal::Color::Blue, DGtal::Color::None ) );
aBoard << anAlphaSegment2;



FCConstIterator fcIt = fc.begin();
while (anAlphaSegment3.extendFront(*fcIt)) {
fcIt++;
}


aBoard << CustomStyle( anAlphaSegment3.className(), new CustomColors( DGtal::Color::Green, DGtal::Color::None ) );
aBoard << CustomStyle( anAlphaSegment3.className(), new CustomColors( DGtal::Color::Green, DGtal::Color::None ) );
aBoard << anAlphaSegment3;



aBoard.saveEPS("exampleAlphaThickSegment.eps");

Expand Down
2 changes: 1 addition & 1 deletion examples/io/viewers/viewer3D-8bis-2Dimages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main( int argc, char** argv )
//! [ExampleViewer3D2DImagesExtractImagesNonSliceExtract]
// Extracting images from 3D embeder
DGtal::functors::Point2DEmbedderIn3D<DGtal::Z3i::Domain > embedder(imageVol.domain(),
ptCenter+DGtal::Z3i::RealPoint(200.0*cos(alpha),100.0*sin(alpha)),
ptCenter+DGtal::Z3i::Point(static_cast<int>(200.0*cos(alpha)),static_cast<int>(100.0*sin(alpha))),
DGtal::Z3i::RealPoint(cos(alpha),sin(alpha),cos(2.0*alpha)),
IMAGE_PATCH_WIDTH);
ImageAdapterExtractor extractedImage(imageVol, domainImage2D, embedder, idV);
Expand Down
8 changes: 4 additions & 4 deletions src/DGtal/geometry/curves/AlphaThickSegmentComputer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class AlphaThickSegmentComputer

typedef typename InputPointContainer::iterator Iterator;
typedef TConstIterator ConstIterator;
typedef ParallelStrip< SpaceND< 2, DGtal::int32_t > ,true,true> Primitive;
typedef ParallelStrip< SpaceND< 2, DGtal::int32_t > ,true,true> Primitive;

/**
* Type of embedded points
Expand Down Expand Up @@ -663,9 +663,9 @@ class AlphaThickSegmentComputer
* @param[out] ptProjected the projected point.
* @return true if ptProjected is inside the segment [A,B].
**/
template<typename TPointD>
bool projectOnStraightLine(const TPointD & ptA, const TPointD & ptB,
const TPointD & ptC, PointD & ptProjected) const;
template<typename TPoint, typename TPointD>
bool projectOnStraightLine(const TPoint & ptA, const TPoint & ptB,
const TPoint & ptC, TPointD & ptProjected) const;


/**
Expand Down
Loading

0 comments on commit dafb5d8

Please sign in to comment.