if (aDataType == GL_NONE)
continue;
- OpenGl_VertexBuffer::bindAttribute(theGlCtx, anAttrib.Id, aNbComp,
+ OpenGl_VertexBuffer::bindAttribute(theGlCtx, anAttrib.Id, aNbComp,
aDataType, Stride, anOffset);
anOffset += Graphic3d_Attribute::Stride (anAttrib.DataType);
}
public:
/// Constructor
/// \param theObj a presentation
- SketcherPrs_Element(const Handle(SketcherPrs_SymbolPrs)& theObj) :
+ SketcherPrs_Element(const Handle(SketcherPrs_SymbolPrs)& theObj) :
OpenGl_Element(), myObj(theObj) {}
/// Render the current presentation
/// Releases OpenGL resources
/// \param theContext OpenGL context
- virtual void Release (OpenGl_Context* theContext)
+ virtual void Release (OpenGl_Context* theContext)
{
if (!myObj.IsNull())
myObj->Release(theContext);
{
Handle(SketcherPrs_SymbolPrs) anIObj = (SketcherPrs_SymbolPrs*)theUserDraw->Data;
if (anIObj.IsNull()) {
- std::cout <<
+ std::cout <<
"VUserDrawCallback error: null object passed, the custom scene element will not be rendered"
<< std::endl;
}
std::map<const char*, Handle(Image_AlienPixMap)> SketcherPrs_SymbolPrs::myIconsMap;
-SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
+SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane), myIsConflicting(false)
{
// Create an aspect with the icon
if (myAspect.IsNull()) {
Handle(Image_AlienPixMap) aIcon = icon();
- if (aIcon.IsNull())
+ if (aIcon.IsNull())
myAspect = new Graphic3d_AspectMarker3d();
else
myAspect = new Graphic3d_AspectMarker3d(aIcon);
}
}
-void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup,
+void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup,
std::string theAttrName) const
{
ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, theAttrName);
}
void SketcherPrs_SymbolPrs::HilightOwnerWithColor(
- const Handle(PrsMgr_PresentationManager3d)& thePM,
- const Quantity_NameOfColor theColor,
+ const Handle(PrsMgr_PresentationManager3d)& thePM,
+ const Quantity_NameOfColor theColor,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
thePM->Color(this, theColor);
void SketcherPrs_SymbolPrs::Compute(
const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
+ const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
{
// Create an icon
prepareAspect();
Handle(AIS_InteractiveContext) aCtx = GetContext();
- Handle(OpenGl_GraphicDriver) aDriver =
+ Handle(OpenGl_GraphicDriver) aDriver =
Handle(OpenGl_GraphicDriver)::DownCast(aCtx->CurrentViewer()->Driver());
if (!aDriver.IsNull()) {
// register the custom element factory function
// Update points with default shift value
// it updates array of points if the presentation is ready to display, or the array of points
// contains the previous values
-
+
bool aReadyToDisplay = updateIfReadyToDisplay(20);
int aNbVertex = myPntArray->VertexNumber();
if (theConflicting)
{
if (!myAspect.IsNull())
- myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255.,
+ myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255.,
theColor[2] / 255., Quantity_TOC_RGB));
myIsConflicting = true;
}
// this method is a combination of OCCT OpenGL functions. The main purpose is to have
// equal distance from the source object to symbol indpendently of zoom.
// It is base on OCCT 6.9.1 and might need changes when using later OCCT versions.
- // The specific SHAPER modifications are marked by ShaperModification:start/end,
+ // The specific SHAPER modifications are marked by ShaperModification:start/end,
// other is OCCT code
// do not update presentation for invalid or already removed objects: the presentation
const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker(Standard_True);
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
Handle(OpenGl_View) aView = theWorkspace->ActiveView();
-
+
// ShaperModification:start
double aScale = aView->Camera()->Scale();
// Update points coordinate taking the viewer scale into account
}
// Update drawing attributes
- if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements,
+ if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements,
aAttribs->Data(), GL_NONE, aAttribs->Stride)) {
myVboAttribs->Release (aCtx.operator->());
myVboAttribs.Nullify();
return;
}
-
+
Handle(OpenGl_Texture) aTextureBack = theWorkspace->DisableTexture();
const Handle(OpenGl_PointSprite)& aSpriteNorm = anAspectMarker->SpriteRes(aCtx);
-
+
if (!aSpriteNorm.IsNull() && !aSpriteNorm->IsDisplayList()) {
// ShaperModification:start : filling the presentation with color if there is a conflict
- const bool toHilight =
+ const bool toHilight =
(theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) != 0 || myIsConflicting;
// ShaperModification:end
- const Handle(OpenGl_PointSprite)& aSprite =
- (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())?
+ const Handle(OpenGl_PointSprite)& aSprite =
+ (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())?
anAspectMarker->SpriteHighlightRes(aCtx)
: aSpriteNorm;
theWorkspace->EnableTexture (aSprite);
- aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False,
+ aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False,
Standard_False, anAspectMarker->ShaderProgramRes(aCtx));
const TEL_COLOUR* aLineColor = &anAspectMarker->Color();
if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT)
}
}
-void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr<GeomAPI_Shape>& theShape,
+void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr<GeomAPI_Shape>& theShape,
const Handle(Prs3d_Presentation)& thePrs) const
{
if (theShape->isEdge()) {
// The shape is edge
- std::shared_ptr<GeomAPI_Curve> aCurve =
+ std::shared_ptr<GeomAPI_Curve> aCurve =
std::shared_ptr<GeomAPI_Curve>(new GeomAPI_Curve(theShape));
if (aCurve->isLine()) {
// The shape is line
- GeomAdaptor_Curve
+ GeomAdaptor_Curve
aCurv(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
StdPrs_Curve::Add(thePrs, aCurv, myDrawer);
} else {
// The shape is circle or arc
- GeomAdaptor_Curve
+ GeomAdaptor_Curve
aAdaptor(aCurve->impl<Handle(Geom_Curve)>(), aCurve->startParam(), aCurve->endParam());
StdPrs_DeflectionCurve::Add(thePrs,aAdaptor,myDrawer);
}
} else if (theShape->isVertex()) {
// draw vertex
- std::shared_ptr<GeomAPI_Vertex> aVertex =
+ std::shared_ptr<GeomAPI_Vertex> aVertex =
std::shared_ptr<GeomAPI_Vertex>(new GeomAPI_Vertex(theShape));
std::shared_ptr<GeomAPI_Pnt> aPnt = aVertex->point();
Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl<gp_Pnt>());
}
void SketcherPrs_SymbolPrs::drawListOfShapes(
- const std::shared_ptr<ModelAPI_AttributeRefList>& theListAttr,
+ const std::shared_ptr<ModelAPI_AttributeRefList>& theListAttr,
const Handle(Prs3d_Presentation)& thePrs) const
{
int aNb = theListAttr->size();