本文整理汇总了C++中ON_BinaryArchive::WriteDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_BinaryArchive::WriteDouble方法的具体用法?C++ ON_BinaryArchive::WriteDouble怎么用?C++ ON_BinaryArchive::WriteDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_BinaryArchive
的用法示例。
在下文中一共展示了ON_BinaryArchive::WriteDouble方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
ON_BOOL32 ON_AngularDimension::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = ON_Annotation::Write( file );
if( rc )
rc = file.WriteDouble( m_angle );
if( rc )
rc = file.WriteDouble( m_radius );
return rc;
}
示例2: Write
BOOL ON_BrepTrim::Write( ON_BinaryArchive& file ) const
{
ON_3dPoint P(0.0,0.0,0.0);
BOOL rc = file.WriteInt( m_trim_index );
int i;
if ( rc )
rc = file.WriteInt( m_c2i );
if ( rc )
rc = file.WriteInterval( ProxyCurveDomain() );
if ( rc )
rc = file.WriteInt( m_ei );
if ( rc )
rc = file.WriteInt( 2, m_vi );
if ( rc )
rc = file.WriteInt( m_bRev3d );
i = m_type;
if ( rc )
rc = file.WriteInt( i );
i = m_iso;
if ( rc )
rc = file.WriteInt( i );
if ( rc )
rc = file.WriteInt( m_li );
if ( rc )
rc = file.WriteDouble( 2, m_tolerance );
if ( file.Archive3dmVersion() < 3 )
{
if ( rc )
rc = file.WritePoint( P ); // m_P[0] );
if ( rc )
rc = file.WritePoint( P ); // m_P[1] );
}
else
{
// trim proxy curve information added in version 200206180
if (rc )
rc = file.WriteInterval( Domain() );
unsigned char b[24];
memset(b,0,sizeof(b));
b[0] = ProxyCurveIsReversed() ? 1 : 0;
if (rc)
rc = file.WriteChar(8,b);
b[0] = 0;
if (rc)
rc = file.WriteChar(24,b);
}
if ( rc )
rc = file.WriteDouble( m__legacy_2d_tol );
if ( rc )
rc = file.WriteDouble( m__legacy_3d_tol );
return rc;
}
示例3: Write
BOOL ON_Hatch::Write( ON_BinaryArchive& ar) const
{
BOOL rc = ar.Write3dmChunkVersion(1,1);
if (rc) rc = ar.WritePlane( m_plane);
if (rc) rc = ar.WriteDouble( m_pattern_scale);
if (rc) rc = ar.WriteDouble( m_pattern_rotation);
if (rc) rc = ar.WriteInt( m_pattern_index);
if (rc)
{
int i, count = m_loops.Count();
if( count < 0 )
count = 0;
BOOL rc = ar.WriteInt( count);
for( i = 0; i < count && rc; i++)
rc = m_loops[i]->Write( ar);
}
return rc;
}
示例4:
BOOL
ON_BrepVertex::Write( ON_BinaryArchive& file ) const
{
BOOL rc = file.WriteInt( m_vertex_index );
if ( rc )
rc = file.WritePoint( point );
if ( rc )
rc = file.WriteArray( m_ei );
if ( rc )
rc = file.WriteDouble( m_tolerance );
return rc;
}
示例5: Write
ON_BOOL32 ON_Light::Write(
ON_BinaryArchive& file
) const
{
int i;
ON_BOOL32 rc = file.Write3dmChunkVersion(1,2);
// version 1.0 fields
if ( rc ) rc = file.WriteInt( m_bOn );
i = m_style;
if ( rc ) rc = file.WriteInt( i );
if ( rc ) rc = file.WriteDouble( m_intensity );
if ( rc ) rc = file.WriteDouble( m_watts );
if ( rc ) rc = file.WriteColor( m_ambient );
if ( rc ) rc = file.WriteColor( m_diffuse );
if ( rc ) rc = file.WriteColor( m_specular );
if ( rc ) rc = file.WriteVector( m_direction );
if ( rc ) rc = file.WritePoint( m_location );
if ( rc ) rc = file.WriteDouble( m_spot_angle );
if ( rc ) rc = file.WriteDouble( m_spot_exponent );
if ( rc ) rc = file.WriteVector( m_attenuation );
if ( rc ) rc = file.WriteDouble( m_shadow_intensity );
if ( rc ) rc = file.WriteInt( m_light_index );
if ( rc ) rc = file.WriteUuid( m_light_id );
if ( rc ) rc = file.WriteString( m_light_name );
// version 1.1 added support for linear and rectangular
if ( rc ) rc = file.WriteVector( m_length );
if ( rc ) rc = file.WriteVector( m_width );
// version 1.2 added m_hotspot support
if ( rc ) rc = file.WriteDouble( m_hotspot );
return rc;
}
示例6: Write
bool ON_BezierCage::Write(ON_BinaryArchive& archive) const
{
bool rc = archive.BeginWrite3dmChunk(TCODE_ANONYMOUS_CHUNK,1,0);
if (rc)
{
rc = archive.WriteInt(m_dim);
if(rc)
rc = archive.WriteInt(m_is_rat);
if (rc)
rc = archive.WriteInt(m_order[0]);
if (rc)
rc = archive.WriteInt(m_order[1]);
if (rc)
rc = archive.WriteInt(m_order[2]);
int i,j,k;
const int cv_dim = m_is_rat?(m_dim+1):m_dim;
double* bogus_cv = 0;
for(i = 0; i < m_order[0] && rc; i++)
{
for(j = 0; j < m_order[1] && rc; j++)
{
for ( k = 0; k < m_order[2] && rc; k++)
{
const double* cv = CV(i,j,k);
if ( !cv )
{
if ( 0 == bogus_cv )
{
bogus_cv = (double*)onmalloc(cv_dim*sizeof(*bogus_cv));
for ( int n = 0; n < cv_dim; n++ )
bogus_cv[n] = ON_UNSET_VALUE;
}
cv = bogus_cv;
}
rc = archive.WriteDouble(cv_dim,cv);
}
}
}
if ( 0 != bogus_cv )
onfree(bogus_cv);
if ( !archive.EndWrite3dmChunk() )
{
rc = false;
}
}
return rc;
}
示例7: Write
ON_BOOL32 ON_Font::Write(
ON_BinaryArchive& file // serialize definition to binary archive
) const
{
bool rc = file.Write3dmChunkVersion(1,2);
while(rc)
{
rc = file.WriteInt(m_font_index);
if (!rc) break;
rc = file.WriteString(m_font_name);
if (!rc) break;
{
// 18 October 2002 Dale Lear:
// Lowell, wchar_t has different sizes on different OSs.
// When writing a wchar_t string, you should use one
// of the WriteString functions. This function must continue
// to use WriteShort(64,...) so old files will remain valid.
unsigned short sh[64];
memset(sh,0,sizeof(sh));
int i;
for ( i = 0; i < 64 && i < face_name_size-1; i++ )
sh[i] = m_facename[i];
rc = file.WriteShort(64, sh);
if (!rc) break;
}
// 1.1 additions
rc = file.WriteInt( m_font_weight);
if (!rc) break;
rc = file.WriteInt( m_font_italic);
if (!rc) break;
rc = file.WriteDouble( m_linefeed_ratio);
if (!rc) break;
// 1.2 addition
rc = file.WriteUuid( m_font_id);
if (!rc) break;
// 1.3 addition
// rc = file.WriteInt( m_font_underlined);
// if (!rc) break;
break;
}
return rc;
}
示例8: Write
ON_BOOL32 ON_DetailView::Write( ON_BinaryArchive& archive ) const
{
bool rc = archive.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 1, 1 );
if (!rc)
return false;
for(;;)
{
// m_view is wrapped in a subchunk so ON_3dmView can be expanded
// without breaking the file format.
rc = archive.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 1, 0 );
if (rc)
{
rc = m_view.Write(archive);
if (!archive.EndWrite3dmChunk())
rc = false;
}
if(!rc)
break;
// m_boundary is wrapped in a subchunk so ON_NurbsCurve can be expanded
// without breaking the file format.
rc = archive.BeginWrite3dmChunk( TCODE_ANONYMOUS_CHUNK, 1, 0 );
if (rc)
{
rc = m_boundary.Write(archive)?true:false;
if (!archive.EndWrite3dmChunk())
rc = false;
}
if(!rc)
break;
// 28 Feb 2006 1.1 fields added
rc = archive.WriteDouble(m_page_per_model_ratio);
if ( !rc )
break;
break;
}
if ( !archive.EndWrite3dmChunk() )
rc = false;
return rc;
}
示例9: switch
ON_BOOL32 ON_3dmObjectAttributes::Write( ON_BinaryArchive& file ) const
{
if ( file.Archive3dmVersion() >= 5 )
{
// added at opennurbs version 200712190
return WriteV5Helper(file);
}
bool rc = file.Write3dmChunkVersion(1,7);
// version 1.0 fields
if (rc) rc = file.WriteUuid(m_uuid);
if (rc) rc = file.WriteInt(m_layer_index);
if (rc) rc = file.WriteInt(m_material_index);
if (rc) rc = file.WriteColor(m_color);
if (rc)
{
// OBSOLETE if (rc) rc = file.WriteLineStyle(m_line_style); // 23 March 2005 Dale Lear
short s;
s = (short)m_object_decoration;
if (rc) rc = file.WriteShort(s);
s = 0;
if (rc) rc = file.WriteShort(s);
if (rc) rc = file.WriteDouble(0.0);
if (rc) rc = file.WriteDouble(1.0);
}
if (rc) rc = file.WriteInt(m_wire_density);
if (rc) rc = file.WriteChar(m_mode);
if (rc) rc = file.WriteChar(m_color_source);
if (rc) rc = file.WriteChar(m_linetype_source);
if (rc) rc = file.WriteChar(m_material_source);
if (rc) rc = file.WriteString(m_name);
if (rc) rc = file.WriteString(m_url);
// version 1.1 fields
if (rc) rc = file.WriteArray(m_group);
// version 1.2 fields
if (rc) rc = file.WriteBool(m_bVisible);
// version 1.3 fields
if (rc) rc = file.WriteArray(m_dmref);
// version 1.4 fields - 23 March 2005 Dale Lear
if (rc) rc = file.WriteInt(m_object_decoration);
if (rc) rc = file.WriteChar(m_plot_color_source);
if (rc) rc = file.WriteColor(m_plot_color);
if (rc) rc = file.WriteChar(m_plot_weight_source);
if (rc) rc = file.WriteDouble(m_plot_weight_mm);
// version 1.5 fields 11 April 2005
if (rc) rc = file.WriteInt(m_linetype_index);
// version 1.6 fields 2 September 2005
if (rc)
{
unsigned char uc = 0;
switch(m_space)
{
case ON::no_space: uc = 0; break;
case ON::model_space: uc = 0; break;
case ON::page_space: uc = 1; break;
}
rc = file.WriteChar(uc);
}
if (rc)
{
// 22 Sep 2006 - the way ON_3dmObjectAttiributes indicates
// that an object is put on a particular page view changed
// from being saved in the m_dmref[] list to using the
// m_space and m_viewport_id settings. But the file format
// cannot change at this point. So, the bAddPagespaceDMR
// is here to save the page info in the old dmr format.
int count = m_dmref.Count();
if ( count < 0 )
count = 0;
bool bAddPagespaceDMR = ( ON::page_space == m_space && !ON_UuidIsNil(m_viewport_id) );
rc = file.WriteInt( bAddPagespaceDMR ? (count+1) : count );
if ( rc && bAddPagespaceDMR )
{
rc = file.WriteUuid(m_viewport_id);
if (rc) rc = file.WriteUuid(ON_ObsoletePageSpaceObjectId);
}
int i;
for ( i = 0; i < count && rc; i++ )
{
const ON_DisplayMaterialRef& dmr = m_dmref[i];
rc = file.WriteUuid(dmr.m_viewport_id);
if (rc) rc = file.WriteUuid(dmr.m_display_material_id);
}
}
// version 1.7 fields 6 June 2006
if (rc) rc = m_rendering_attributes.Write(file);
return rc;
}
示例10: while
bool ON_3dmObjectAttributes::WriteV5Helper( ON_BinaryArchive& file ) const
{
unsigned char c;
// 29 Nov. 2009 S. Baer
// Chunk version updated to 2.1 in order to support m_display_order
bool rc = file.Write3dmChunkVersion(2,1);
while(rc)
{
if (!rc) break;
rc = file.WriteUuid(m_uuid);
if (!rc) break;
rc = file.WriteInt(m_layer_index);
if (!rc) break;
// write non-default settings - skip everything else
if ( !m_name.IsEmpty() )
{
c = 1;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteString(m_name);
if (!rc) break;
}
if ( !m_url.IsEmpty() )
{
c = 2;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteString(m_url);
if (!rc) break;
}
if ( -1 != m_linetype_index )
{
c = 3;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_linetype_index);
if (!rc) break;
}
if ( -1 != m_material_index )
{
c = 4;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_material_index);
if (!rc) break;
}
if ( m_rendering_attributes.m_mappings.Count() > 0
|| m_rendering_attributes.m_materials.Count() > 0
|| true != m_rendering_attributes.m_bCastsShadows
|| true != m_rendering_attributes.m_bReceivesShadows
|| false != m_rendering_attributes.AdvancedTexturePreview()
)
{
c = 5;
rc = file.WriteChar(c);
if (!rc) break;
rc = m_rendering_attributes.Write(file);
if (!rc) break;
}
if ( 0 != m_color )
{
c = 6;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteColor(m_color);
if (!rc) break;
}
if ( 0 != m_plot_color )
{
c = 7;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteColor(m_plot_color);
if (!rc) break;
}
if ( 0.0 != m_plot_weight_mm )
{
c = 8;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteDouble(m_plot_weight_mm);
if (!rc) break;
}
if ( ON::no_object_decoration != m_object_decoration )
{
c = 9;
rc = file.WriteChar(c);
if (!rc) break;
c = (unsigned char)m_object_decoration;
rc = file.WriteChar(c);
if (!rc) break;
}
if ( 1 != m_wire_density )
{
c = 10;
rc = file.WriteChar(c);
if (!rc) break;
rc = file.WriteInt(m_wire_density);
if (!rc) break;
//.........这里部分代码省略.........
示例11: Write
BOOL ON_Layer::Write(
ON_BinaryArchive& file // serialize definition to binary archive
) const
{
int i;
bool rc = file.Write3dmChunkVersion(1,8);
while(rc)
{
// Save OBSOLETE mode value so we don't break file format
if ( m_bVisible )
i = 0; // "normal" layer mode
else if ( m_bLocked )
i = 2; // "locked" layer mode
else
i = 1; // "hidden" layer mode
rc = file.WriteInt( i );
if (!rc) break;
rc = file.WriteInt( m_layer_index );
if (!rc) break;
rc = file.WriteInt( m_iges_level );
if (!rc) break;
rc = file.WriteInt( m_material_index );
if (!rc) break;
// Starting with version 200312110, this value is zero. For files written
// with earlier versions, the number was a "model index" value that was
// set to something >= 1, but never used. We have to continue to
// read/write an integer here so that old/new versions of opennurbs can
// read files written by new/old versions.
i = 0;
rc = file.WriteInt( i );
if (!rc) break;
rc = file.WriteColor( m_color );
if (!rc) break;
{
// OBSOLETE LINE STYLE if ( rc ) rc = file.WriteLineStyle( LineStyle() );
// Starting with version 200503170, this section is "officially" not used.
// Prior to that, it was old ON_LineStyle information that has
// never been used.
short s = 0;
if (rc) rc = file.WriteShort(s); // default pattern
if (rc) rc = file.WriteShort(s); // default pattern index
if (rc) rc = file.WriteDouble(0.0); // default thickness
if (rc) rc = file.WriteDouble(1.0); // default scale
}
if (!rc) break;
rc = file.WriteString( m_name );
if (!rc) break;
// 1.1 fields
rc = file.WriteBool(m_bVisible);
if (!rc) break;
// 1.2 field
rc = file.WriteInt( m_linetype_index);
if (!rc) break;
// 1.3 field - 23 March 2005 Dale Lear
rc = file.WriteColor( m_plot_color);
if (!rc) break;
rc = file.WriteDouble( m_plot_weight_mm);
if (!rc) break;
// 1.4 field - 3 May 2005 Dale Lear
// - locked and visible are independent settings
rc = file.WriteBool( m_bLocked );
if (!rc) break;
// 1.5 field
rc = file.WriteUuid( m_layer_id );
if (!rc) break;
// 1.6 field
rc = file.WriteUuid( m_parent_layer_id );
if (!rc) break;
// 1.6 field
rc = file.WriteBool( m_bExpanded );
if (!rc) break;
// 1.7 field - added 6 June 2006
rc = m_rendering_attributes.Write(file);
if (!rc) break;
// 1.8 field - added 19 Sep 2006
rc = file.WriteUuid(m_display_material_id);
break;
}
return rc;
}
示例12: Write
ON_BOOL32 ON_InstanceDefinition::Write(
ON_BinaryArchive& binary_archive
) const
{
bool rc = binary_archive.Write3dmChunkVersion(1,5);
// version 1.0 fields
if ( rc )
rc = binary_archive.WriteUuid( m_uuid );
if ( rc )
{
if ( binary_archive.Archive3dmVersion() >= 4
&& ON_InstanceDefinition::linked_def == m_idef_update_type )
{
// linked instance definition geometry is never in the file
ON_SimpleArray<ON_UUID> empty_uuid_list;
rc = binary_archive.WriteArray( empty_uuid_list );
}
else
{
rc = binary_archive.WriteArray( m_object_uuid );
}
}
if ( rc )
rc = binary_archive.WriteString( m_name );
if ( rc )
rc = binary_archive.WriteString( m_description );
if ( rc )
rc = binary_archive.WriteString( m_url );
if ( rc )
rc = binary_archive.WriteString( m_url_tag );
if ( rc )
rc = binary_archive.WriteBoundingBox( m_bbox );
// m_idef_update_type was an unsigned int and got changed to an enum. Read and write
// as an unsigned int to support backwards compatibility
if ( rc )
rc = binary_archive.WriteInt( (unsigned int)m_idef_update_type );
if ( rc )
rc = binary_archive.WriteString( m_source_archive );
// version 1.1 fields
if (rc)
rc = m_source_archive_checksum.Write( binary_archive );
// version 1.2 fields
if (rc)
rc = binary_archive.WriteInt( m_us.m_unit_system );
// version 1.3 fields - added 6 March 2006
if (rc)
rc = binary_archive.WriteDouble( m_us.m_custom_unit_scale );
if ( rc )
rc = binary_archive.WriteBool( m_source_bRelativePath );
// version 1.4 fields
if (rc)
rc = m_us.Write(binary_archive);
// version 1.5 fields
if (rc)
rc = binary_archive.WriteInt(m_idef_update_depth);
return rc;
}
示例13: Write
ON_BOOL32 ON_InstanceDefinition::Write(
ON_BinaryArchive& binary_archive
) const
{
bool rc = binary_archive.Write3dmChunkVersion(1,6);
// version 1.0 fields
if ( rc )
rc = binary_archive.WriteUuid( m_uuid );
if ( rc )
{
if ( binary_archive.Archive3dmVersion() >= 4
&& ON_InstanceDefinition::linked_def == m_idef_update_type )
{
// linked instance definition geometry is never in the file
ON_SimpleArray<ON_UUID> empty_uuid_list;
rc = binary_archive.WriteArray( empty_uuid_list );
}
else
{
rc = binary_archive.WriteArray( m_object_uuid );
}
}
if ( rc )
rc = binary_archive.WriteString( m_name );
if ( rc )
rc = binary_archive.WriteString( m_description );
if ( rc )
rc = binary_archive.WriteString( m_url );
if ( rc )
rc = binary_archive.WriteString( m_url_tag );
if ( rc )
rc = binary_archive.WriteBoundingBox( m_bbox );
// m_idef_update_type was an unsigned int and got changed to an enum. Read and write
// as an unsigned int to support backwards compatibility
const unsigned int idef_update_type = (unsigned int)this->IdefUpdateType();
if ( rc )
rc = binary_archive.WriteInt( idef_update_type );
if ( rc )
{
// 7 February 2012
// Purge source archive information from static_defs
if ( ON_InstanceDefinition::static_def == idef_update_type )
{
ON_wString empty_string;
rc = binary_archive.WriteString( empty_string );
}
else
rc = binary_archive.WriteString( m_source_archive );
}
// version 1.1 fields
if (rc)
{
// 7 February 2012
// Purge source archive information from static_defs
if ( ON_InstanceDefinition::static_def == idef_update_type )
ON_CheckSum::UnsetCheckSum.Write(binary_archive);
else
rc = m_source_archive_checksum.Write( binary_archive );
}
// version 1.2 fields
if (rc)
rc = binary_archive.WriteInt( m_us.m_unit_system );
// version 1.3 fields - added 6 March 2006
if (rc)
rc = binary_archive.WriteDouble( m_us.m_custom_unit_scale );
if ( rc )
{
bool b = (ON_InstanceDefinition::static_def == idef_update_type)
? false
: m_source_bRelativePath;
rc = binary_archive.WriteBool( b );
}
// version 1.4 fields
if (rc)
rc = m_us.Write(binary_archive);
// version 1.5 fields
if (rc)
rc = binary_archive.WriteInt(m_idef_update_depth);
// version 1.6 fields ( added 14 February 2012 )
if (rc)
rc = binary_archive.WriteInt( m_idef_layer_style );
return rc;
}