~ubuntu-branches/ubuntu/utopic/slic3r/utopic

« back to all changes in this revision

Viewing changes to xs/src/Surface.cpp

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2014-06-17 01:27:26 UTC
  • Revision ID: package-import@ubuntu.com-20140617012726-2wrs4zdo251nr4vg
Tags: upstream-1.1.4+dfsg
ImportĀ upstreamĀ versionĀ 1.1.4+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "Surface.hpp"
 
2
 
 
3
namespace Slic3r {
 
4
 
 
5
double
 
6
Surface::area() const
 
7
{
 
8
    return this->expolygon.area();
 
9
}
 
10
 
 
11
bool
 
12
Surface::is_solid() const
 
13
{
 
14
    return this->surface_type == stTop
 
15
        || this->surface_type == stBottom
 
16
        || this->surface_type == stBottomBridge
 
17
        || this->surface_type == stInternalSolid;
 
18
}
 
19
 
 
20
bool
 
21
Surface::is_external() const
 
22
{
 
23
    return this->surface_type == stTop
 
24
        || this->surface_type == stBottom
 
25
        || this->surface_type == stBottomBridge;
 
26
}
 
27
 
 
28
bool
 
29
Surface::is_bottom() const
 
30
{
 
31
    return this->surface_type == stBottom
 
32
        || this->surface_type == stBottomBridge;
 
33
}
 
34
 
 
35
bool
 
36
Surface::is_bridge() const
 
37
{
 
38
    return this->surface_type == stBottomBridge
 
39
        || this->surface_type == stInternalBridge;
 
40
}
 
41
 
 
42
#ifdef SLIC3RXS
 
43
 
 
44
REGISTER_CLASS(Surface, "Surface");
 
45
 
 
46
void
 
47
Surface::from_SV_check(SV* surface_sv)
 
48
{
 
49
    if (!sv_isa(surface_sv, perl_class_name(this)) && !sv_isa(surface_sv, perl_class_name_ref(this)))
 
50
        CONFESS("Not a valid %s object", perl_class_name(this));
 
51
    // a XS Surface was supplied
 
52
    *this = *(Surface *)SvIV((SV*)SvRV( surface_sv ));
 
53
}
 
54
#endif
 
55
 
 
56
}