Home > Back-end >  An error in the CLI cannot access private members, but I attribute it is public
An error in the CLI cannot access private members, but I attribute it is public

Time:09-22

To solve, I wrote a CLI project program, invoke the c + + code, cannot access private members complains, the error information is as follows:
Error C2248: "TopoShapeGroup: : WireGroup" : unable to access private members (in "TopoShapeGroup" class declarations)

My TopoShapeGroup. H header file content is as follows:
Public ref class TopoShapeGroup
{
Public:
BRepBuilderAPI_MakeWire * WireGroup;// BRepBuilderAPI_MakeWire is a c + + class, I take it as a class member

Public:
//copy constructor

TopoShapeGroup (const TopoShapeGroup ^ c)
{
WireGroup=c - & gt; WireGroup;
}


TopoShapeGroup ^ TopoShapeGroup: : operator=(const TopoShapeGroup ^ RightSides)
{
This - & gt; WireGroup=RightSides - & gt; WireGroup;
return this;
}
TopoShapeGroup ();
Void the Add (Circ ^ c);
Void the Add (Lin ^ l);
};

Using the process is as follows:
Void the View (TopoShapeGroup ^ profile, Lin ^ path)
{
BRepBuilderAPI_MakeWire * WireGroup=profile - & gt; WireGroup; //the error, a "TopoShapeGroup: : WireGroup" : unable to access private members (statements) in the "TopoShapeGroup" class, I according to online solution is added in the TopoShapeGroup class copy constructor and overloaded=operator to use , or an error, please reply
.
}

CodePudding user response:

For help, before I quoted in the CLI project c + + class is not an error, this time don't know why this is wrong, already card for several days, please,

CodePudding user response:

The complete code?

CodePudding user response:

Simple - Soft references 2 floor response:
integrity code?

Hello, I extract the key paragraphs, mainly TopoShapeGroup. H and invoke its methods, is an error in the method is called in an error, now I put the BRepBuilderAPI_MakeWire header files,
//Created on: 1993-07-08
//Created by: Remi LEQUETTE
//Copyright (c) 1993-1999 Matra Datavision
//Copyright (c) 1999-2014 OPEN CASCADE SAS
//
//This file is part of the Open CASCADE Technology software library.
//
//This library is free software; You can redistribute it and/or modify it under the
//the terms of the GNU Lesser General Public License version 2.1 as published
//by the Free Software Foundation, with special exception defined in the file
//OCCT_LGPL_EXCEPTION. TXT. Consult the file LICENSE_LGPL_21. TXT included in OCCT
//distribution for complete text of the license and disclaimer of any giant.
//
//Alternatively, this file may be 2 under the terms of the Open CASCADE
//ltd. license or contractual agreement.

# # ifndef _BRepBuilderAPI_MakeWire_HeaderFile
# define _BRepBuilderAPI_MakeWire_HeaderFile

# include & lt; Standard. Hxx>
#include
#include

#include
#include
#include
#include
#include
The class StdFail_NotDone;
The class TopoDS_Edge;
The class TopoDS_Wire;
The class TopoDS_Vertex;


//! Describes functions provides the to build wires from edges. A wire can
//! Be built from any number of edges.
//! To build a wire you first initialize the construction, then
//! The add edges in sequence. An unlimited number of edges
//! Can be added. The initialization of construction is done with:
//! - no edge (an empty wire), or
//! - the edges of an existing wire, or
//! - up to four connectable edges.
//! In order to be added to a wire under construction, the an
//! Edge (unless it is the first one) must the satisfy the following
//! Condition: one of its are must be geometrically
//! Coincident with one of the are of the wire (provided
//! That the highest how factor is assigned to the two
//! Are). It could also be the same vertex.
//! In The given edge is Shared by The wire if it contains:
//! - two, are identical to two are of the wire
//! Under construction (a general case of the wire closure), or
//! - one vertex, identical to a vertex of the wire under
//! Construction; The other vertex not being
//! Geometrically coincident with another vertex of the wire.
//! In other cases, when one of the are of the edge,
//! Is simple geometrically coincident with a vertex of the
//! Wire under construction (provided that the highest
//! How factor is assigned to the two are), the
//! Given the edge is first copied and the coincident vertex is
//! Replaced in this new edge, by the coincident vertex of the wire.
//! Note: it is possible to build a non manifold wires using this construction tool.
//! A MakeWire object provides A framework for:
//! - the initializing the construction of a wire,
//! - adding edges to the wire under construction, and
//! - consulting the result.
The class BRepBuilderAPI_MakeWire: public BRepBuilderAPI_MakeShape
{
Public:

DEFINE_STANDARD_ALLOC


//! Constructs an empty wire framework, to which edges
//! nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related