Class: OpenCV::Cv::Point3d

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/ruby/ropencv/ropencv_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr) ⇒ Point3d

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Point3d.



3946
3947
3948
3949
3950
3951
3952
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3946

def initialize(ptr)
    @__obj_ptr__ = if ptr.is_a? Point3dStruct
                       ptr
                   else
                       Point3dStruct.new(FFI::AutoPointer.new(ptr,Point3dStruct.method(:release)))
                   end
end

Instance Attribute Details

#__obj_ptr__Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3943
3944
3945
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3943

def __obj_ptr__
  @__obj_ptr__
end

Class Method Details

.from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



3938
3939
3940
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3938

def self.from_native(ptr,context)
    rbind_from_native(ptr,context)
end

.new(*args) ⇒ Object

Raises:

  • (ArgumentError)


3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3882

def self.new(*args)
    if args.first.is_a?(FFI::Pointer) || args.first.is_a?(Point3dStruct)
        raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1
        return super(args.first)
    end
    # wrapper for cv::Point3d::Point3d(double x, double y, double z)
    @@cv_point_3d_point_3d_defaults0 ||= [nil, nil, nil]
    if(args.size >= 3 && args.size <= 3)
        args.size.upto(2) do |i|
            args[i] = @@cv_point_3d_point_3d_defaults0[i]
        end
        begin
            return Rbind::cv_point_3d_point_3d(*args)
        rescue TypeError => e
            @error = e
        end
    end

    # wrapper for cv::Point3d::Point3d(const cv::Point3d pt)
    @@cv_point_3d_point_3d2_defaults1 ||= [nil]
    if(args.size >= 1 && args.size <= 1)
        args.size.upto(0) do |i|
            args[i] = @@cv_point_3d_point_3d2_defaults1[i]
        end
        begin
            return Rbind::cv_point_3d_point_3d2(*args)
        rescue TypeError => e
            @error = e
        end
    end

    raise ArgumentError, "no constructor for #{self}(#{args.inspect})"
end

.rbind_from_native(ptr, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3926
3927
3928
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3926

def self.rbind_from_native(ptr,context)
    Point3d.new(ptr)
end

.rbind_to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3917
3918
3919
3920
3921
3922
3923
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3917

def self.rbind_to_native(obj,context)
    if obj.is_a? Point3d
        obj.__obj_ptr__
    else
        raise TypeError, "expected kind of #{name}, was #{obj.class}"
    end
end

.to_native(obj, context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

can be overwritten by the user



3932
3933
3934
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3932

def self.to_native(obj,context)
    rbind_to_native(obj,context)
end

Instance Method Details

#+(pt) ⇒ Object

wrapper for void cv::Point3d::operator+(const cv::Point3d pt)



4019
4020
4021
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4019

def +(pt)
    Rbind::cv_point_3d_operator_plus( self, pt)
end

#__owner__?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

returns true if the underlying pointer is owner of the real object

Returns:

  • (Boolean)


3957
3958
3959
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3957

def __owner__?
    @__obj_ptr__[:bowner]
end

#cross(pt) ⇒ Object

wrapper for cv::Point3d cv::Point3d::cross(const cv::Point3d pt)



4011
4012
4013
4014
4015
4016
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4011

def cross(pt)
    result = Rbind::cv_point_3d_cross( self, pt)
    # store owner insight the pointer to not get garbage collected
    result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) if !result.__owner__?
    result
end

#ddot(pt) ⇒ Object

wrapper for double cv::Point3d::ddot(const cv::Point3d pt)



4006
4007
4008
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4006

def ddot(pt)
    Rbind::cv_point_3d_ddot( self, pt)
end

#dot(pt) ⇒ Object

wrapper for double cv::Point3d::dot(const cv::Point3d pt)



4001
4002
4003
# File 'lib/ruby/ropencv/ropencv_types.rb', line 4001

def dot(pt)
    Rbind::cv_point_3d_dot( self, pt)
end

#xObject

methods wrapper for double x



3971
3972
3973
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3971

def x()
    Rbind::cv_point_3d_getx( self)
end

#x=(value) ⇒ Object

wrapper for double x



3976
3977
3978
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3976

def x=(value)
    Rbind::cv_point_3d_setx( self, value)
end

#yObject

wrapper for double y



3981
3982
3983
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3981

def y()
    Rbind::cv_point_3d_gety( self)
end

#y=(value) ⇒ Object

wrapper for double y



3986
3987
3988
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3986

def y=(value)
    Rbind::cv_point_3d_sety( self, value)
end

#zObject

wrapper for double z



3991
3992
3993
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3991

def z()
    Rbind::cv_point_3d_getz( self)
end

#z=(value) ⇒ Object

wrapper for double z



3996
3997
3998
# File 'lib/ruby/ropencv/ropencv_types.rb', line 3996

def z=(value)
    Rbind::cv_point_3d_setz( self, value)
end