本文整理汇总了C++中ON_BinaryArchive::ReadPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::ReadPoint方法的具体用法?C++ ON_BinaryArchive::ReadPoint怎么用?C++ ON_BinaryArchive::ReadPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::ReadPoint方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
ON_BOOL32 ON_Point::Read( ON_BinaryArchive& file )
{
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if (rc && major_version==1) {
// common to all 1.x versions
rc = file.ReadPoint(point);
}
return rc;
}
示例2: Read
ON_BOOL32 ON_Light::Read(
ON_BinaryArchive& file
)
{
Default();
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( rc && major_version == 1 ) {
int i;
// version 1.0 fields
i = 0;
if ( rc ) rc = file.ReadInt( &i );
if ( rc ) Enable(i);
if ( rc ) rc = file.ReadInt( &i );
if ( rc ) SetStyle(ON::LightStyle(i));
if ( rc ) rc = file.ReadDouble( &m_intensity );
if ( rc ) rc = file.ReadDouble( &m_watts );
if ( rc ) rc = file.ReadColor( m_ambient );
if ( rc ) rc = file.ReadColor( m_diffuse );
if ( rc ) rc = file.ReadColor( m_specular );
if ( rc ) rc = file.ReadVector( m_direction );
if ( rc ) rc = file.ReadPoint( m_location );
if ( rc ) rc = file.ReadDouble( &m_spot_angle );
if ( rc ) rc = file.ReadDouble( &m_spot_exponent );
if ( rc ) rc = file.ReadVector( m_attenuation );
if ( rc ) rc = file.ReadDouble( &m_shadow_intensity );
if ( rc ) rc = file.ReadInt( &m_light_index );
if ( rc ) rc = file.ReadUuid( m_light_id );
if ( rc ) rc = file.ReadString( m_light_name );
if ( minor_version < 2 ) {
// set hotspot from 1.0 or 1.1 m_spot_exponent
double h = 1.0 - m_spot_exponent/128.0;
if ( h < 0.0 )
h = 0.0;
else if ( h > 1.0 )
h = 1.0;
m_hotspot = h;
m_spot_exponent = 0.0;
}
if ( minor_version >= 1 ) {
// version 1.1 fields
if ( rc ) rc = file.ReadVector( m_length );
if ( rc ) rc = file.ReadVector( m_width );
if ( minor_version >= 2 ) {
// version 1.2 fields
if ( rc ) rc = file.ReadDouble( &m_hotspot );
}
}
}
return rc;
}
示例3: Read
BOOL CSampleObjectUserData::Read( ON_BinaryArchive& binary_archive )
{
int major_version = 0;
int minor_version = 0;
bool rc = binary_archive.BeginRead3dmChunk( TCODE_ANONYMOUS_CHUNK, &major_version, &minor_version );
if( !rc )
return false;
// Read class members like this
for(;;)
{
rc = ( 1 == major_version );
if( !rc ) break;
// version 1.0 fields
rc = binary_archive.ReadPoint( m_point );
if( !rc ) break;
rc = binary_archive.ReadString( m_string );
if( !rc ) break;
// The code in the comment below demonstrates how to
// correctly read information added in later releases
// of your product.
//if ( minor_version >= 1 )
//{
// // version 1.1 fields added DD MMM YYYY
// rc = binary_archive.ReadSomethingNew( ... );
// if (!rc) break;
// rc = binary_archive.ReadSomethingElseNew( ... );
// if (!rc) break;
//
// if ( minor_version >= 2 )
// {
// // version 1.2 fields added DD MMM YYYY
// rc = binary_archive.ReadAnotherSomethingNew( ... );
// if (!rc) break;
// rc = binary_archive.ReadAnotherSomethingElseNew( ... );
// if (!rc) break;
// }
//}
break;
}
// If BeginRead3dmChunk() returns true,
// then EndRead3dmChunk() must be called,
// even if a read operation failed.
if( !binary_archive.EndRead3dmChunk() )
rc = false;
return rc;
}
示例4:
BOOL
ON_BrepVertex::Read( ON_BinaryArchive& file )
{
BOOL rc = file.ReadInt( &m_vertex_index );
if ( rc )
rc = file.ReadPoint( point );
if ( rc )
rc = file.ReadArray( m_ei );
if ( rc )
rc = file.ReadDouble( &m_tolerance );
return rc;
}
示例5: Read
ON_BOOL32 ON_AnnotationArrow::Read(ON_BinaryArchive& file)
{
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( major_version == 1 ) {
if (rc) rc = file.ReadPoint( m_tail );
if (rc) rc = file.ReadPoint( m_head );
}
else {
rc = false;
}
return rc;
}
示例6: Read
BOOL ON_HatchLine::Read( ON_BinaryArchive& ar)
{
m_angle = 0.0;
m_base.Set( 0.0, 0.0);
m_offset.Set( 0.0, 1.0);
m_dashes.Empty();
int major_version = 0;
int minor_version = 0;
BOOL rc = ar.Read3dmChunkVersion( &major_version, &minor_version);
if ( major_version == 1 )
{
if ( rc) rc = ar.ReadDouble( &m_angle);
if ( rc) rc = ar.ReadPoint( m_base);
if ( rc) rc = ar.ReadVector( m_offset);
if ( rc) rc = ar.ReadArray( m_dashes);
}
return rc;
}
示例7: Read
ON_BOOL32 ON_HatchExtra::Read(ON_BinaryArchive& archive)
{
int major_version = 0;
int minor_version = 0;
bool rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if(major_version != 1)
rc = false;
m_basepoint.Set(0.0,0.0);
if(rc) rc = archive.ReadUuid(m_parent_hatch);
if(rc) rc = archive.ReadPoint(m_basepoint);
if(!archive.EndRead3dmChunk())
rc = false;
return rc;
}
示例8: Read
bool ON_Localizer::Read(ON_BinaryArchive& archive)
{
Destroy();
int major_version = 0;
int minor_version = 0;
bool rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version);
if (!rc)
return false;
for(;;)
{
rc = (1 == major_version);
if ( !rc ) break;
int i = no_type;
rc = archive.ReadInt(&i);
if ( !rc ) break;
switch(i)
{
case sphere_type: m_type = sphere_type; break;
case plane_type: m_type = plane_type; break;
case cylinder_type: m_type = cylinder_type; break;
case curve_type: m_type = curve_type; break;
case surface_type: m_type = surface_type; break;
case distance_type: m_type = distance_type; break;
}
rc = archive.ReadPoint(m_P);
if ( !rc ) break;
rc = archive.ReadVector(m_V);
if ( !rc ) break;
rc = archive.ReadInterval(m_d);
if ( !rc ) break;
int mjv = 0, mnv = 0;
rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&mjv,&mnv);
if (!rc) break;
rc = (1 == mjv);
bool bReadCurve = false;
if (rc)
rc = archive.ReadBool( &bReadCurve );
if ( rc && bReadCurve)
{
m_nurbs_curve = new ON_NurbsCurve();
rc = m_nurbs_curve->Read(archive)?true:false;
}
if ( !archive.EndRead3dmChunk() )
rc = false;
if (!rc) break;
rc = archive.BeginRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&mjv,&mnv);
if (!rc) break;
rc = (1 == mjv);
bool bReadSurface = false;
rc = archive.ReadBool( &bReadSurface );
if ( rc && bReadSurface )
{
m_nurbs_surface = new ON_NurbsSurface();
rc = m_nurbs_surface->Read(archive)?true:false;
}
if ( !archive.EndRead3dmChunk() )
rc = false;
if (!rc) break;
break;
}
if ( !archive.EndRead3dmChunk() )
rc = false;
return rc;
}
示例9: if
bool ON_Brep::ReadOld200( ON_BinaryArchive& file, int minor_version )
{
bool rc = true;
// read legacy trimmed surface collection from Rhino 2.0
int face_count = 0;
int edge_count = 0;
int loop_count = 0;
int trim_count = 0;
int outer_flag = 0;
ON_BoundingBox bnd_2d_bbox;
int i, fi, fbi, fbcnt, bti, btcnt, twin_index;
int ftype_flag, btype_flag, gcon_flag, mono_flag;
char b;
if (rc) rc = file.ReadInt( &face_count );
if (rc) rc = file.ReadInt( &edge_count );
if (rc) rc = file.ReadInt( &loop_count );
if (rc) rc = file.ReadInt( &trim_count );
if ( face_count < 1 || edge_count < 1 || loop_count < 1 || trim_count < 1 )
rc = false;
if (rc) rc = file.ReadInt( &outer_flag );
if (rc) rc = file.ReadPoint( m_bbox.m_min );
if (rc) rc = file.ReadPoint( m_bbox.m_max );
// 2d curves
m_C2.Reserve(trim_count);
for ( i = 0; rc && i < trim_count; i++ ) {
ON_PolyCurve* curve = new ON_PolyCurve();
rc = curve->Read( file )?true:false;
if ( curve->Count() == 1 ) {
m_C2.Append( curve->HarvestSegment(0) );
delete curve;
}
else
m_C2.Append( curve );
}
const int c2_count = m_C2.Count();
// 3d curves
m_C3.Reserve(edge_count);
for ( i = 0; rc && i < edge_count; i++ ) {
ON_PolyCurve* curve = new ON_PolyCurve();
rc = curve->Read( file )?true:false;
if ( curve->Count() == 1 ) {
m_C3.Append( curve->HarvestSegment(0) );
delete curve;
}
else
m_C3.Append( curve );
}
const int c3_count = m_C3.Count();
// make a new edge for each 3d curve
m_E.Reserve(c3_count);
for ( i = 0; i < c3_count && rc; i++ )
{
NewEdge(i);
}
// 3d surfaces
m_S.Reserve(face_count);
for ( i = 0; rc && i < face_count; i++ ) {
ON_NurbsSurface* surface = new ON_NurbsSurface();
rc = surface->Read( file )?true:false;
m_S.Append( surface );
}
ON_SimpleArray<int> te_index(trim_count);
ON_SimpleArray<int> te_twin_index(trim_count);
m_F.Reserve(face_count);
m_L.Reserve(loop_count);
m_T.Reserve(trim_count);
for ( fi = 0; rc && fi < face_count; fi++ )
{
ftype_flag = 0;
fbcnt = 0;
ON_BrepFace& f = NewFace(fi);
if (rc) rc = file.ReadInt( &i ); // legacy face index
if (rc) rc = file.ReadInt( &i ); // OBSOLETE f.m_material_index
int k = f.m_bRev;
if (rc) rc = file.ReadInt( &k );
if (rc) f.m_bRev = (k!=0);
if (rc) rc = file.ReadInt( &ftype_flag );
if (rc) rc = file.ReadPoint( f.m_bbox.m_min );
if (rc) rc = file.ReadPoint( f.m_bbox.m_max );
if (rc) rc = file.ReadInt( &fbcnt);
if (fbcnt < 1 )
rc = false;
for ( fbi = 0; rc && fbi < fbcnt; fbi++ ) {
btype_flag = 0;
ON_BrepLoop::TYPE looptype = ON_BrepLoop::unknown;
if (rc) rc = file.ReadInt( &i ); // legacy loop index
if (rc) rc = file.ReadInt( &btype_flag );
//.........这里部分代码省略.........
示例10: Read
//.........这里部分代码省略.........
}
}
}
// loops
if (rc)
{
rc = m_L.Read(file);
if ( rc )
{
for ( i = 0; i < m_L.Count(); i++ )
{
m_L[i].m_brep = this;
}
}
}
// faces
if (rc)
{
rc = m_F.Read(file);
if (rc) {
for ( i = 0; i < m_F.Count(); i++ ) {
ON_BrepFace& f = m_F[i];
f.m_brep = this;
if ( f.m_si >= 0 && f.m_si < S_count )
f.SetProxySurface(m_S[f.m_si]);
}
}
}
// bounding box
if (rc)
rc = file.ReadPoint( m_bbox.m_min );
if (rc)
rc = file.ReadPoint( m_bbox.m_max );
// fill in missing information
ReadFillInMissingBoxes(*this);
// end of chunk version 3.0
if (rc && minor_version >= 1 )
{
// added for chunk version 3.1
ON_Object* obj;
unsigned int tcode;
int value, fi;
unsigned char b;
const int face_count = m_F.Count();
// read render meshes
rc = file.BeginRead3dmChunk( &tcode, &value );
if ( rc )
{
if ( tcode != TCODE_ANONYMOUS_CHUNK )
rc = false;
else
{
for ( fi = 0; rc && fi < face_count; fi++ )
{
rc = file.ReadChar(&b);
if (rc && b)
{
示例11: ReadFillInMissingBoxes
//.........这里部分代码省略.........
delete pO; // ERROR!
m_C2.Append( pC );
pC = NULL;
pO = NULL;
}
// 3d curves
file.ReadInt( &count );
m_C3.Reserve(count);
for ( i = 0; i < count; i++ )
{
pO = NULL;
file.ReadObject( &pO );
pC = ON_Curve::Cast(pO);
if ( !pC )
delete pO; // ERROR!
m_C3.Append( pC );
pC = NULL;
pO = NULL;
}
// untrimmed surfaces
file.ReadInt( &count );
m_S.Reserve(count);
for ( i = 0; i < count; i++ )
{
pO = NULL;
file.ReadObject( &pO );
pS = ON_Surface::Cast(pO);
if ( !pS )
delete pO; // ERROR!
m_S.Append( pS );
pS = NULL;
pO = NULL;
}
// vertices
file.ReadInt( &count );
m_V.Reserve(count);
m_V.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_V[i].Read(file);
}
// edges
file.ReadInt( &count );
m_E.Reserve(count);
m_E.SetCount(count);
for ( i = 0; i < count; i++ )
{
ON_BrepEdge& edge = m_E[i];
edge.Read(file);
edge.SetProxyCurve( edge.m_c3i >= 0 ? m_C3[edge.m_c3i] : 0 );
edge.m_brep = this;
}
// trims
file.ReadInt( &count );
m_T.Reserve(count);
m_T.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_T[i].Read(file);
ON_BrepTrim& trim = m_T[i];
trim.SetProxyCurve( trim.m_c2i >= 0 ? m_C2[trim.m_c2i] : 0 );
trim.m_brep = this;
}
// loops
file.ReadInt( &count );
m_L.Reserve(count);
m_L.SetCount(count);
for ( i = 0; i < count; i++ )
{
m_L[i].Read(file);
m_L[i].m_brep = this;
}
// faces
file.ReadInt( &count );
m_F.Reserve(count);
m_F.SetCount(count);
for ( i = 0; i < count; i++ )
{
ON_BrepFace& face = m_F[i];
face.Read(file);
face.SetProxySurface(face.m_si >= 0 ? m_S[face.m_si] : 0);
face.m_brep = this;
}
// bounding box
file.ReadPoint( m_bbox.m_min );
file.ReadPoint( m_bbox.m_max );
// fill in missing information
ReadFillInMissingBoxes(*this);
return true;
}