Example #1
0
RestoreFrame* RestoreFrame::findFrameFor(DatabasePtr db)
{
    BaseFrame* bf = frameFromIdString(getFrameId(db));
    if (!bf)
        return 0;
    return dynamic_cast<RestoreFrame*>(bf);
}
EventWatcherFrame* EventWatcherFrame::findFrameFor(DatabasePtr db)
{
    BaseFrame* bf = frameFromIdString(getFrameId(db));
    if (!bf)
        return 0;
    return dynamic_cast<EventWatcherFrame*>(bf);
}
Example #3
0
 onut::Texture* SpriteAnim::getTexture() const
 {
     if (m_pCurrentAnim)
     {
         return m_pCurrentAnim->frames[getFrameId()].pTexture;
     }
     return nullptr;
 }
Example #4
0
 const Vector2& SpriteAnim::getOrigin() const
 {
     if (m_pCurrentAnim)
     {
         return m_pCurrentAnim->frames[getFrameId()].origin;
     }
     static Vector2 ret(.5f, .5f);
     return ret;
 }
Example #5
0
 const Vector4& SpriteAnim::getUVs() const
 {
     if (m_pCurrentAnim)
     {
         return m_pCurrentAnim->frames[getFrameId()].UVs;
     }
     static Vector4 ret(0, 0, 1, 1);
     return ret;
 }
Example #6
0
void
Frame::computeAccelerationDep(void) const
{
    if (hasParent()) {
        mParentSpAccel = motionFromParent(getParentFrame()->getSpAccel());
        mReferenceFrameId = getParentFrame()->getRefFrameId();
    } else {
        mParentSpAccel = Vector6::zeros();
        mReferenceFrameId = getFrameId();
    }
    mDirtySpAccel = false;
}
Example #7
0
void
Frame::computeVelocityDep(void) const
{
    if (hasParent()) {
        mParentSpVel = motionFromParent(getParentFrame()->getSpVel());
        mRefVel = getRelVel() + motionFromParent(getParentFrame()->getRefVel());
        mReferenceFrameId = getParentFrame()->getRefFrameId();
    } else {
        mParentSpVel = Vector6::zeros();
        mRefVel = Vector6::zeros();
        mReferenceFrameId = getFrameId();
    }
    mDirtySpVel = false;
}
Example #8
0
void
Frame::computePositionDep(void) const
{
    if (hasParent()) {
        mRefOrient = getParentFrame()->getRefOrientation()*getOrientation();
        mRefPos = getParentFrame()->posToRef(getPosition());
        mReferenceFrameId = getParentFrame()->getRefFrameId();
    } else {
        mRefOrient = getOrientation();
        mRefPos = getPosition();
        mReferenceFrameId = getFrameId();
    }
    mDirtyPos = false;
}
Example #9
0
void TXRequest::assemblePacket(){
    packet.clear();
    packet.append(getFrameType());
    packet.append(getFrameId());
    packet.append(getDestAddr64());
    packet.append(getDestAddr16());
    packet.append(getBroadcastRadius());
    packet.append(getTransmitOptions());
    packet.append(getData());
    setLength(packet.size());
    createChecksum(packet);
    packet.append(getChecksum());
    packet.insert(0, getStartDelimiter());
    packet.insert(1, getLength());

}
Example #10
0
RestoreFrame::RestoreFrame(wxWindow* parent, DatabasePtr db)
    : BackupRestoreBaseFrame(parent, db)
{
    setIdString(this, getFrameId(db));

    wxString databaseName(db->getName_());
    wxString serverName(db->getServer()->getName_());
    SetTitle(wxString::Format(_("Restore Database \"%s:%s\""),
        serverName.c_str(), databaseName.c_str()));

    createControls();
    layoutControls();
    updateControls();

    text_ctrl_filename->SetFocus();
}
Example #11
0
EventWatcherFrame::EventWatcherFrame(wxWindow* parent, DatabasePtr db)
    : BaseFrame(parent, -1, wxEmptyString), databaseM(db), eventsM(0)
{
    wxASSERT(db);
    timerM.SetOwner(this, ID_timer);

    setIdString(this, getFrameId(db));
    // observe database object to close on disconnect / destruction
    db->attachObserver(this, false);
    SetTitle(wxString::Format(_("Event Monitor for Database: %s"),
        db->getName_().c_str()));

    createControls();
    layoutControls();
    updateControls();

    button_add->SetFocus();

    #include "new.xpm"
    wxBitmap bmp(new_xpm);
    wxIcon icon;
    icon.CopyFromBitmap(bmp);
    SetIcon(icon);
}
Example #12
0
void SkeletonStream::renderSkeleton(const Eigen::Matrix3Xd& skeleton)
{
    visualization_msgs::MarkerArray marker_array;
    visualization_msgs::Marker marker;

    marker.header.frame_id = getFrameId();
    marker.header.stamp = ros::Time::now();

    marker.action = visualization_msgs::Marker::ADD;
    marker.pose.orientation.w = 1;
    marker.pose.orientation.x = 0;
    marker.pose.orientation.y = 0;
    marker.pose.orientation.z = 0;
    marker.id = 0;

    // spheres
    marker.type = visualization_msgs::Marker::SPHERE_LIST;
    marker.scale.x = 0.1; // 10cm
    marker.scale.y = 0.1;
    marker.scale.z = 0.1;
    marker.color.r = 0.5;
    marker.color.g = 0.5;
    marker.color.b = 0.5;
    marker.color.a = 1.0;
    marker.pose.position.x = 0;
    marker.pose.position.y = 0;
    marker.pose.position.z = 0;
    for (int i=0; i<joint_names_.size(); i++)
    {
        geometry_msgs::Point point;

        marker.ns = joint_names_[i];

        point.x = skeleton(0, i);
        point.y = skeleton(1, i);
        point.z = skeleton(2, i);
        marker.points.push_back(point);
    }
    marker_array.markers.push_back(marker);

    // texts
    marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
    marker.id = 1;
    marker.scale.x = 0.1; // 10cm
    marker.scale.y = 0.1;
    marker.scale.z = 0.1;
    marker.color.r = 1.0;
    marker.color.g = 1.0;
    marker.color.b = 1.0;
    marker.color.a = 1.0;
    for (int i=0; i<joint_names_.size(); i++)
    {
        marker.ns = joint_names_[i];

        marker.text = joint_names_[i];
        marker.pose.position.x = skeleton(0, i);
        marker.pose.position.y = skeleton(1, i);
        marker.pose.position.z = skeleton(2, i);

        marker_array.markers.push_back(marker);
    }

    marker_array_publisher_.publish(marker_array);
}