本文整理汇总了C++中Marker::getColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Marker::getColor方法的具体用法?C++ Marker::getColor怎么用?C++ Marker::getColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marker
的用法示例。
在下文中一共展示了Marker::getColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: equals
bool Marker::equals( const Marker& other ) const
{
/*
* \note these first two are commented as the basic shape ability has been
* removed from marker at this point.
*/
// This gets too complicated to check.
//if ( !usesDefault ) return false;
// This one default, other not.
//if ( !other.hasDefaultMark() ) return false;
return ((this->shapeEquals(other)) && (markerColor == other.getColor()));
// Check if the marks are different.
//if ( mark != other.getMark() ) return false;
// Check if the mark colors are different.
//if ( markerColor != other.getColor() ) return false;
// Check if the ranges are different
//if ( range != other.getRange() ) return false;
// Bothe use the same default mark and color.
//return true;
}
示例2: drawInFrame
void SeriesList::drawInFrame(Frame& innerFrame, double minX, double maxX, double minY, double maxY)
{
double multX = innerFrame.getWidth()/(maxX-minX);
double multY = innerFrame.getHeight()/(maxY-minY);
// Draw lines
for(int i=0;i<getNumSeries();i++)
{
innerFrame.push_state();
StrokeStyle s = getStyle(i);
Marker m = getMarker(i);
if(m.getColor().isClear() && s.getColor().isClear())
{
innerFrame << Comment("Plot contained data with clear stroke and marker. Skipping.");
continue;
}
vector< pair<double,double> >& vec = getPointList(i);
Path curve(vec,innerFrame.lx(), innerFrame.ly());
// What I'd give for a line of haskell...
// map (\(x,y) -> (multX*(x-minX), multY*(y-minY))) vector
map_object map_instance(multX,minX,multY,minY);
innerFrame.setMarker(m);
innerFrame.setLineStyle(s);
if(s.getColor().isClear())
{
// crop
auto_ptr< Path > cropX = Splitter::cropToBox(minX,maxX,minY,maxY,curve);
// Fit it to the box.
std::for_each(cropX->begin(), cropX->end(), map_instance);
// Draw the line
innerFrame.line(*cropX);
}
else
{
// interpolate
auto_ptr< std::list<Path> > interpX = Splitter::interpToBox(minX,maxX,minY,maxY,curve);
for(std::list<Path>::iterator i=interpX->begin();i!=interpX->end();i++)
{
// Fit it to the box
std::for_each(i->begin(), i->end(), map_instance);
// Draw the line
innerFrame.line(*i);
}
}
innerFrame.pop_state();
}
}
示例3: defineMarker
void SVGImage::defineMarker (const Marker& marker, int dfltname)
{
if( lastMarker == marker ) return;
using namespace std;
string name = marker.uniqueName();
//cout << name << endl;;
string savedtab=tab;
string marktab=string(" ");
string intab=string(" ");
ostr << tab << "<defs>\n";
double r = marker.getRange();
double r2 = 2*r;
ostr << marktab << "<marker id=\"" << name << "\" markerUnits=\"strokeWidth\" "
<< "markerWidth=\"" << r2 << "\" markerHeight=\"" << r2 << "\" "
<< "viewBox=\"0 0 " << r2 << " " << r2 << "\" \n"
<< marktab << " " << "refX=\"" << r << "\" refY=\"" << r << "\" ";
string col;
{
stringstream ss;
ss.fill('0');
ss << '#' << hex << setw(6) << marker.getColor().getRGB();
col = ss.str();
}
// These are here just in case.
ostr.fill('0');
ostr << "stroke-width=\".2pt\" " << "fill=\"none\">\n";
// Initial marker tab is set up...now to put the shape in...
if (marker.hasDefaultMark())
{
Marker::Mark mark = marker.getMark();
switch(mark)
{
case Marker::DOT:
ostr << intab << "<circle cx=\"" << r << "\" cy=\"" << r << "\" "
<<"r=\"" << r << "\" style=\"fill:" << col << ";stroke:" << col << "\"/>\n";
break;
case Marker::PLUS:
ostr << intab << "<line x1=\"0\" y1=\"" << r << "\" "
<< "x2=\"" << r2 << "\" y2=\"" << r << "\"/>\n";
ostr << intab << "<line x1=\"" << r << "\" y1=\"0\" "
<< "x2=\"" << r << "\" y2=\"" << r2 << "\"/>\n";
break;
case Marker::X:
ostr << intab << "<line x1=\"0\" y1=\"0\" "
<< "x2=\"" << r2 << "\" y2=\"" << r2 << "\"/>\n";
ostr << intab << "<line x1=\"" << r2 << "\" y1=\"0\" "
<< "x2=\"0\" y2=\"" << r2 << "\"/>\n";
break;
}
}
else
{
//This should not be called as BasicShapes were removed...but left
// here as a placeholder if it ever comes back.
//Todo:
// * Make sure marker color works as necessary (useMarkerColor)
// * Add some to the tab variable?
// * Need to fix shape coordinates?
//ostr << intab << markerShape << endl;
}
ostr << marktab << "</marker>\n";
ostr << tab << "</defs>\n";
markerDefined = true;
lastMarker = marker;
}