04-10-2017, 07:13 PM
I think I understand the first and last steps, but there's a chasm in between that's eluding me. Say I start with:
hdi::core:athStyle pStyl = (*iter)->path()->style();
hdi::core::ArtColor:atternStyle patStyl(pStyl.fill.color.pattern());
Now I have a copy of the original PathStyle, and a copy of the PatternStyle. I modify the PatternStyle like so:
patStyl.transform.setIdentity();
patStyl.shiftDistance = 0.0;
patStyl.shiftAngle = hdi::core::Angle::Zero();
etc.
Next, my choices for ArtColor constructors that I see in hdicoreArtColor.h are:
* ArtColor(const ArtColor& c_);
So I try many variations like this:
pStyl.fill.color = hdi::core::ArtColor(patStyl);
pStyl.fill = hdi::core::FillStyle(patStyl);
All I've tried give "no matching conversion" errors.
* ArtColor(const double grayVal_);
* ArtColor(const double rVal_, const double gVal_, const double bVal_);
* ArtColor(const double cVal_, const double mVal_, const double yVal_, const double kVal_);
Obviously none of these is appropriate.
* ArtColor();
This generic route seems to be a possibility, but I can't find a way to coerce the PatternStyle into it. Besides, the existing copy is already of type TypePattern, a setting I can't find a way to programmatically set in an empty object.
* ArtColor& operator=(const ArtColor& rhs_); // doesn't work either
Once I somehow plug the PatternStyle into the temporary PathStyle, I can assign it back to the original art like so:
(*iter)->path()->setStyle(pStyl);
Could you please show me the code I need (in place of the lines above in blue) to add my PatternStyle to the ArtColor in my PaintStyle variable so I can apply it? It would be a huge help.
hdi::core:athStyle pStyl = (*iter)->path()->style();
hdi::core::ArtColor:atternStyle patStyl(pStyl.fill.color.pattern());
Now I have a copy of the original PathStyle, and a copy of the PatternStyle. I modify the PatternStyle like so:
patStyl.transform.setIdentity();
patStyl.shiftDistance = 0.0;
patStyl.shiftAngle = hdi::core::Angle::Zero();
etc.
Next, my choices for ArtColor constructors that I see in hdicoreArtColor.h are:
* ArtColor(const ArtColor& c_);
So I try many variations like this:
pStyl.fill.color = hdi::core::ArtColor(patStyl);
pStyl.fill = hdi::core::FillStyle(patStyl);
All I've tried give "no matching conversion" errors.
* ArtColor(const double grayVal_);
* ArtColor(const double rVal_, const double gVal_, const double bVal_);
* ArtColor(const double cVal_, const double mVal_, const double yVal_, const double kVal_);
Obviously none of these is appropriate.
* ArtColor();
This generic route seems to be a possibility, but I can't find a way to coerce the PatternStyle into it. Besides, the existing copy is already of type TypePattern, a setting I can't find a way to programmatically set in an empty object.
* ArtColor& operator=(const ArtColor& rhs_); // doesn't work either
Once I somehow plug the PatternStyle into the temporary PathStyle, I can assign it back to the original art like so:
(*iter)->path()->setStyle(pStyl);
Could you please show me the code I need (in place of the lines above in blue) to add my PatternStyle to the ArtColor in my PaintStyle variable so I can apply it? It would be a huge help.